Repository navigation
fix(quiz): shuffle options per attempt so answers can't be found by position - #226
Merged
Merged
Conversation
…osition Each new attempt draws a presentation order per question and stores it in the attempt: options for single-choice and multi-select, responses for matching, and the starting order of items for ordering, which never starts correct. True/false keeps its order. Answers stay in bank indices and strings, so scoring and stored results are unchanged. Attempts stored without a presentation order load and render in bank order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Quiz answers could be found by position. The quiz showed options in bank order and never shuffled them. In most banks every single-choice answer was option A, and every multi-select included A. And 25 of the 41 ordering questions started with their items already in the correct order. A learner could reach the 80% milestone (ADR 0005) without reading the questions.
Fix: shuffle per attempt, in code
presentation(display position → bank index). It covers options for single-choice and multi-select, responses for matching, and the starting order of items for ordering, which never starts correct. True/false keeps its order.presentation. They load and render in bank order, and a reload keeps the order.Validation
npx tsc -b, lint,npm run test:run(1,538 tests in 108 files) and build pass.Unchanged
An ordering question the learner never touches still counts as unanswered, as before. Because the start is never correct, it would be wrong either way.
🤖 Generated with Claude Code