Skip to content

Feature: Lock quiz after first answer and show correct option (#740)#761

Open
narang24 wants to merge 1 commit intoCircuitVerse:masterfrom
narang24:feature/#740-quiz-lock
Open

Feature: Lock quiz after first answer and show correct option (#740)#761
narang24 wants to merge 1 commit intoCircuitVerse:masterfrom
narang24:feature/#740-quiz-lock

Conversation

@narang24
Copy link

@narang24 narang24 commented Feb 7, 2026

Fixes #740

Changes done:

  • Locked quiz after first answer selection
  • Disabled all other options after selection
  • Automatically highlighted correct answer when a wrong option is chosen

Screenshots

After fix:

  • Only one selection allowed
  • Correct answer highlighted automatically
Quiz after fix

Preview Link(s):

(To be added after checks complete)

✅️ By submitting this PR, I have verified the following

  • Checked to see if a similar PR has already been opened 🤔️
  • Reviewed the contributing guidelines 🔍️
  • Sample preview link added
  • Tried squashing the commits into one

Summary by CodeRabbit

  • New Features
    • Prevents multiple answer selections per question
    • Visually highlights selected answers
    • Reveals correct answer when an incorrect choice is made
    • Locks questions after selection to prevent changes

@coderabbitai
Copy link

coderabbitai bot commented Feb 7, 2026

Walkthrough

The quiz answer selection function is rewritten to prevent multiple answer selections and provide clearer feedback. A per-question locking mechanism is implemented using stored data to block further selections after the first answer is chosen. When an incorrect answer is selected, the correct answer is automatically displayed. All answer buttons within the question are disabled after selection by removing onclick handlers and disabling pointer events via CSS.

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: locking the quiz after the first answer selection and displaying the correct option when wrong answers are chosen.
Linked Issues check ✅ Passed The code changes implement all core requirements from issue #740: preventing multiple selections via per-question locking, showing selected answers with appropriate styling, and revealing correct answers when wrong options are chosen.
Out of Scope Changes check ✅ Passed All changes are directly aligned with issue #740 requirements; no out-of-scope modifications were introduced.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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 :In Pop Quiz part of ROM-based µcontrollers page under Sequential LSI

1 participant