Code Executives now includes a shared timed quiz system for every learning module except the Playground.
- Each attempt uses 5 questions.
- Each attempt has a 10-minute timer.
- Every module bank contains 30+ scenario-based questions.
- Attempts and results are stored in localStorage so the learner can resume an in-progress quiz after a refresh.
- Wrong answers include deep links back into the relevant module sections.
Quiz banks live at the repository root in quiz-banks/.
Naming convention:
quiz-banks/javascript.quiz.jsonquiz-banks/rxjs.quiz.jsonquiz-banks/git.quiz.jsonquiz-banks/datastructures.quiz.jsonquiz-banks/react.quiz.jsonquiz-banks/nextjs.quiz.jsonquiz-banks/bigo.quiz.jsonquiz-banks/python.quiz.jsonquiz-banks/systemdesign.quiz.jsonquiz-banks/typescript.quiz.jsonquiz-banks/ai.quiz.jsonquiz-banks/nodejs.quiz.jsonquiz-banks/devops.quiz.jsonquiz-banks/auth.quiz.json
Every bank is a single JSON object:
{
"moduleId": "javascript",
"moduleTitle": "JavaScript",
"description": "Scenario-based assessment...",
"version": 1,
"timeLimitMinutes": 10,
"questionsPerAttempt": 5,
"questions": []
}Each question must include:
idtypedifficultyscenariopromptexplanationtagsreferences
Supported question types:
single-choicemulti-selecttrue-falseorderingmatching
Type-specific fields:
single-choiceandtrue-false:options,correctAnswer:numbermulti-select:options,correctAnswer:number[]ordering:items,correctAnswer:string[]matching:premises,responses,correctAnswer:number[]
src/shared/components/quiz/ModuleQuizSection.tsxsrc/shared/components/quiz/QuestionRenderer.tsxsrc/shared/hooks/useQuizSession.tssrc/shared/constants/moduleNavigation.tssrc/types/quiz.tssrc/utils/quiz.ts
Per-module storage keys use the prefix code-executives.quiz.
For each module:
code-executives.quiz.{module}.active-attemptcode-executives.quiz.{module}.results
The active-attempt key stores:
- selected question ids
- current answers
- current question index
- start timestamp
- expiry timestamp
The results key stores recent local summaries so learners can see prior scores and tiers.
Question references use exact section labels from src/shared/constants/moduleNavigation.ts.
At review time the runtime resolves those labels into module section links so learners can jump directly back into the source material.
Use the workspace custom agent:
.github/agents/module-quiz-generator.agent.md
Its responsibilities:
- read the full existing module bank first
- inspect the module source content
- generate only scenario-based, non-trivial questions
- avoid duplicate questions and duplicate answer sets for near-identical prompts
- preserve stable ids for unchanged questions
- append new question ids sequentially
- Keep question prompts scenario-based.
- Prefer advanced and expert prompts over recall-only trivia.
- Use exact section labels already defined for the module.
- Keep explanations diagnostic and instructional.
- Do not move quiz banks into
src/orpublic/; the root-levelquiz-banks/directory is canonical.
Before merging quiz-bank changes:
- Confirm the JSON file remains valid.
- Confirm
moduleIdmatches the filename. - Confirm there are 30+ questions.
- Confirm at least 5 questions can be sampled without duplicate ids.
- Confirm reference labels exist in
src/shared/constants/moduleNavigation.ts. - Run
npm run buildto confirm the loader still compiles.
