Skip to content

feat: add multi_select question type for multiple correct answers#7

Merged
Lawndlwd merged 1 commit intomainfrom
claude/issue-6-20260419-1612
Apr 23, 2026
Merged

feat: add multi_select question type for multiple correct answers#7
Lawndlwd merged 1 commit intomainfrom
claude/issue-6-20260419-1612

Conversation

@Lawndlwd
Copy link
Copy Markdown
Owner

Closes #6

Adds a new multi_select question type where players must select all correct answers.

Changes:

  • DB: additive migrations for correct_indices and chosen_indices columns
  • Server: correctness requires exact index match; results broadcast includes correctIndices
  • Admin quiz builder: checkbox UI to mark multiple correct answers
  • Player UI: checkbox-style selection with explicit Submit button
  • Results: all correct options highlighted; JSON import supports correctIndices array

Generated with Claude Code

Adds a new `multi_select` question type allowing questions where players
must select all correct answers (2+) from a list of options.

Changes:
- DB: add `correct_indices` (questions) and `chosen_indices` (answers) columns via migration
- Server types: add `multi_select` to QuestionType, update DbQuestion, DbAnswer, QuizQuestion, PlayerAnswerPayload
- Admin routes: persist/parse correct_indices in quiz CRUD endpoints
- Socket: handle multi_select correctness (exact match of all indices), store chosen_indices
- Client types: add multi_select, correctIndices to ImportQuestion/QuestionResults/LeaderboardEntry
- QuestionEditor: checkbox-style correct answer selection for multi_select
- CreateQuiz/EditQuiz: multi_select validation + JSON schema example
- Game.tsx: selectedIndices state + toggleMultiSelectIndex + submitMultiSelect
- QuestionScreen: checkbox toggle UI with Submit button for multi_select
- ResultsScreen: highlight all correctIndices for multi_select

Co-authored-by: Levende <Lawndlwd@users.noreply.github.com>
@Lawndlwd Lawndlwd merged commit 14abf78 into main Apr 23, 2026
1 check passed
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.

[Feature]: Allow multiple choice answers

1 participant