Skip to content

feat(quiz): add matching, ordering, coding, and essay question types#59

Open
nymulinfoinlet wants to merge 1 commit intomainfrom
feat/question-types
Open

feat(quiz): add matching, ordering, coding, and essay question types#59
nymulinfoinlet wants to merge 1 commit intomainfrom
feat/question-types

Conversation

@nymulinfoinlet
Copy link
Copy Markdown
Contributor

Summary

  • Adds 4 new question types (matching, ordering, coding, essay) to the quiz system, expanding from 4 to 8 supported types
  • Implements partial credit scoring for matching (per-pair) and ordering (per-position) questions
  • Integrates code-sandbox service for auto-grading coding questions against test cases
  • Integrates AI service for rubric-based essay evaluation with score + feedback
  • Updates the AI quiz generator prompts to produce all 8 question types
  • New types are premium-only (existing FREE_QUIZ_TYPES gate unchanged)

Changes

  • quiz-generator.service.ts — Extended QuestionType union, added metadata interfaces (MatchingPair, CodingTestCase), updated AI generation prompts with new type schemas
  • quiz.service.ts — Added CodeSandboxService and AiService dependencies, metadata field on QuizQuestion, score/feedback fields on QuizAttemptAnswer, new grading methods (checkMatchingAnswer, checkOrderingAnswer, checkCodingAnswer, checkEssayAnswer) with partial credit
  • quiz.module.ts — Imported CodeSandboxModule

Test plan

  • Verify npx tsc --noEmit passes with 0 errors
  • Create a quiz with matching questions and verify partial credit scoring
  • Create a quiz with ordering questions and verify position-based partial credit
  • Create a quiz with coding questions and verify test case execution via sandbox
  • Create a quiz with essay questions and verify AI-graded rubric evaluation
  • Verify existing question types (multiple_choice, true_false, short_answer, fill_blank) still work unchanged
  • Verify free users cannot generate new advanced question types

Closes #46

🤖 Generated with Claude Code

Expand the quiz system from 4 to 8 question types to support deeper
assessments. New types include partial credit scoring (matching, ordering),
auto-graded code execution via code-sandbox service (coding), and
AI-evaluated long-form answers with rubric-based feedback (essay).

Closes #46

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(quiz): Add matching, ordering, coding, and essay question types

1 participant