Problem
Readers have no way to self-assess their understanding. Without a quiz at the end of each tutorial, there is no feedback loop for the reader to know if they understood the material.
Proposed Solution
Add an optional quiz block to the Docusaurus MDX format using a custom React component:
import Quiz from '@site/src/components/Quiz';
<Quiz
questions={[
{
question: "What is the time complexity of binary search?",
options: ["O(n)", "O(log n)", "O(n log n)", "O(1)"],
correct: 1,
explanation: "Binary search halves the search space at each step, giving O(log n)."
}
]}
/>
The component renders a multiple-choice question card, reveals the explanation after answering, and shows a score summary at the end of a multi-question quiz.
Additional Context
Level 3 feature. Quiz component must be keyboard-accessible (navigate options with arrow keys, confirm with Enter).
Problem
Readers have no way to self-assess their understanding. Without a quiz at the end of each tutorial, there is no feedback loop for the reader to know if they understood the material.
Proposed Solution
Add an optional quiz block to the Docusaurus MDX format using a custom React component:
The component renders a multiple-choice question card, reveals the explanation after answering, and shows a score summary at the end of a multi-question quiz.
Additional Context
Level 3 feature. Quiz component must be keyboard-accessible (navigate options with arrow keys, confirm with Enter).