[PR #1035] [MERGED] fix(quizzes): correct MCQ answer explanations and add validation #1079

Closed
opened 2026-03-22 15:59:44 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/harvard-edge/cs249r_book/pull/1035
Author: @profvjreddi
Created: 11/5/2025
Status: Merged
Merged: 11/5/2025
Merged by: @profvjreddi

Base: devHead: issue-1034-fix-mcq-answer-references


📝 Commits (1)

  • 5b73a40 fix(quizzes): correct MCQ answer explanations and add validation

📊 Changes

22 files changed (+399 additions, -51 deletions)

View changed files

📝 quarto/contents/core/ai_for_good/ai_for_good_quizzes.json (+1 -1)
📝 quarto/contents/core/benchmarking/footnote_context_quizzes.json (+4 -4)
📝 quarto/contents/core/conclusion/footnote_context_quizzes.json (+1 -1)
📝 quarto/contents/core/data_engineering/data_engineering_quizzes.json (+1 -1)
📝 quarto/contents/core/dl_primer/dl_primer_quizzes.json (+2 -2)
📝 quarto/contents/core/dnn_architectures/dnn_architectures_quizzes.json (+2 -2)
📝 quarto/contents/core/efficient_ai/efficient_ai_quizzes.json (+3 -3)
📝 quarto/contents/core/frameworks/footnote_context_quizzes.json (+1 -1)
📝 quarto/contents/core/frameworks/frontiers_quizzes.json (+2 -2)
📝 quarto/contents/core/frontiers/frontiers_quizzes.json (+2 -2)
📝 quarto/contents/core/hw_acceleration/hw_acceleration_quizzes.json (+5 -5)
📝 quarto/contents/core/introduction/introduction_quizzes.json (+1 -1)
📝 quarto/contents/core/ml_systems/footnote_context_quizzes.json (+1 -1)
📝 quarto/contents/core/ondevice_learning/ondevice_learning_quizzes.json (+3 -3)
📝 quarto/contents/core/ops/ops_quizzes.json (+4 -4)
📝 quarto/contents/core/optimizations/optimizations_quizzes.json (+1 -1)
📝 quarto/contents/core/privacy_security/privacy_security_quizzes.json (+2 -2)
📝 quarto/contents/core/responsible_ai/responsible_ai_quizzes.json (+2 -2)
📝 quarto/contents/core/robust_ai/footnote_context_quizzes.json (+5 -5)
📝 quarto/contents/core/robust_ai/robust_ai_quizzes.json (+4 -4)

...and 2 more files

📄 Description

Addresses #1034

Summary

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

Validation

  • All 445 MCQ questions validated across 35 quiz files
  • No remaining issues found
  • Script tested and working

Closes #1034


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/harvard-edge/cs249r_book/pull/1035 **Author:** [@profvjreddi](https://github.com/profvjreddi) **Created:** 11/5/2025 **Status:** ✅ Merged **Merged:** 11/5/2025 **Merged by:** [@profvjreddi](https://github.com/profvjreddi) **Base:** `dev` ← **Head:** `issue-1034-fix-mcq-answer-references` --- ### 📝 Commits (1) - [`5b73a40`](https://github.com/harvard-edge/cs249r_book/commit/5b73a40b96b512e8ec5451173783e7f3915dad0e) fix(quizzes): correct MCQ answer explanations and add validation ### 📊 Changes **22 files changed** (+399 additions, -51 deletions) <details> <summary>View changed files</summary> 📝 `quarto/contents/core/ai_for_good/ai_for_good_quizzes.json` (+1 -1) 📝 `quarto/contents/core/benchmarking/footnote_context_quizzes.json` (+4 -4) 📝 `quarto/contents/core/conclusion/footnote_context_quizzes.json` (+1 -1) 📝 `quarto/contents/core/data_engineering/data_engineering_quizzes.json` (+1 -1) 📝 `quarto/contents/core/dl_primer/dl_primer_quizzes.json` (+2 -2) 📝 `quarto/contents/core/dnn_architectures/dnn_architectures_quizzes.json` (+2 -2) 📝 `quarto/contents/core/efficient_ai/efficient_ai_quizzes.json` (+3 -3) 📝 `quarto/contents/core/frameworks/footnote_context_quizzes.json` (+1 -1) 📝 `quarto/contents/core/frameworks/frontiers_quizzes.json` (+2 -2) 📝 `quarto/contents/core/frontiers/frontiers_quizzes.json` (+2 -2) 📝 `quarto/contents/core/hw_acceleration/hw_acceleration_quizzes.json` (+5 -5) 📝 `quarto/contents/core/introduction/introduction_quizzes.json` (+1 -1) 📝 `quarto/contents/core/ml_systems/footnote_context_quizzes.json` (+1 -1) 📝 `quarto/contents/core/ondevice_learning/ondevice_learning_quizzes.json` (+3 -3) 📝 `quarto/contents/core/ops/ops_quizzes.json` (+4 -4) 📝 `quarto/contents/core/optimizations/optimizations_quizzes.json` (+1 -1) 📝 `quarto/contents/core/privacy_security/privacy_security_quizzes.json` (+2 -2) 📝 `quarto/contents/core/responsible_ai/responsible_ai_quizzes.json` (+2 -2) 📝 `quarto/contents/core/robust_ai/footnote_context_quizzes.json` (+5 -5) 📝 `quarto/contents/core/robust_ai/robust_ai_quizzes.json` (+4 -4) _...and 2 more files_ </details> ### 📄 Description Addresses #1034 ## Summary 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 ## Validation - ✅ All 445 MCQ questions validated across 35 quiz files - ✅ No remaining issues found - ✅ Script tested and working Closes #1034 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-22 15:59:44 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cs249r_book#1079