Files
cs249r_book/tools
Vijay Janapa Reddi 37e40dee36 fix(quizzes): correct MCQ answer explanations and add validation (#1035)
Addresses #1034

Fixed 47 instances across 20 quiz files where MCQ answer explanations
incorrectly referenced the correct option as one of the incorrect options.

Changes:
1. Fixed all quiz JSON files with incorrect option references
   - Fixed patterns like 'Options A, C, and D' when A is correct
   - Fixed patterns like 'Option C is incorrect' when C is correct
   - Fixed patterns like 'Option A describes...' when A is correct

2. Created fix_mcq_answer_explanations.py script
   - Automatically detects and fixes incorrect option references
   - Handles plural and singular patterns
   - Can be run on all quiz files or specific files

3. Enhanced quizzes.py with validation and opt-in redistribution
   - Added validate_mcq_option_references() function
   - Validation runs during quiz generation to catch LLM errors
   - MCQ redistribution now requires --redistribute-mcq flag (opt-in)
   - Prevents bug from being reintroduced during answer shuffling

All 445 MCQ questions validated across 35 quiz files.
2025-11-05 15:58:54 -05:00
..