Skip to content

feat: add shared module quiz system#34

Merged
mnaimfaizy merged 3 commits intomainfrom
feat/shared-module-quizzes
Apr 9, 2026
Merged

feat: add shared module quiz system#34
mnaimfaizy merged 3 commits intomainfrom
feat/shared-module-quizzes

Conversation

@mnaimfaizy
Copy link
Copy Markdown
Owner

Summary

This PR adds a shared end-of-module quiz system across the learning modules in Code Executives.

The implementation introduces a reusable timed quiz experience, wires it into every supported module as the final section, stores quiz-bank content in root-level JSON files, and documents both the runtime behavior and the authoring workflow for future maintenance.

What Changed

  • Added a shared quiz domain model in src/types/quiz.ts.
  • Added shared quiz utilities in src/utils/quiz.ts for bank loading, validation, grading, answer formatting, sampling, storage keys, and reference resolution.
  • Added useQuizSession in src/shared/hooks/useQuizSession.ts to manage bank loading, timed attempts, localStorage persistence, hydration, navigation, and result history.
  • Added reusable quiz UI components:
    • src/shared/components/quiz/ModuleQuizSection.tsx
    • src/shared/components/quiz/QuestionRenderer.tsx
  • Added centralized module metadata and section navigation in src/shared/constants/moduleNavigation.ts.
  • Updated the sidebar to use shared module navigation data and expose Quiz as the final module section.
  • Integrated the quiz section into all supported learning modules:
    • JavaScript
    • RxJS
    • Git
    • Data Structures
    • React
    • Next.js
    • Big-O
    • Python
    • System Design
    • TypeScript
    • AI Fundamentals
    • Node.js
    • DevOps
    • Authentication & Authorization
  • Added root-level quiz banks under quiz-banks/, one JSON file per module, with scenario-based question sets.
  • Added .github/agents/module-quiz-generator.agent.md to support future bank generation and maintenance workflows.
  • Updated project documentation:
    • README.md
    • docs/Project-Layout-and-Structure.md
    • docs/Quiz-System-Guide.md

Quiz Behavior

  • Each run is timed to 10 minutes.
  • Each run samples 5 questions from the module bank.
  • Banks are structured for larger scenario-based question pools rather than fixed single-run quizzes.
  • Results and active attempts are persisted in localStorage.
  • Incorrect answers surface review links back into the relevant module sections.
  • Recent local history is shown in the shared quiz UI.

Storage And Authoring Model

  • Quiz banks live at the repository root in quiz-banks/{module}.quiz.json.
  • Each module uses a clearly named bank file for easier maintenance and agent discovery.
  • The new shared agent file documents how quiz banks should be created or updated without introducing duplicate questions or answers.

Validation

The branch was validated before opening this PR:

  • npm run build
  • npm run lint
  • npm run test:run

Validation results:

  • Build passed.
  • Lint passed.
  • Tests passed: 21 test files, 211 tests.

Notes

  • The production build still reports existing Vite circular chunk warnings and chunk-size warnings, but the build completes successfully.
  • This PR is focused on the shared quiz system, quiz-bank content, module integration, and supporting docs/authoring workflow.

@mnaimfaizy mnaimfaizy self-assigned this Apr 9, 2026
@mnaimfaizy mnaimfaizy added documentation Improvements or additions to documentation enhancement New feature or request feature New Feature labels Apr 9, 2026
@mnaimfaizy mnaimfaizy merged commit a8658ed into main Apr 9, 2026
9 checks passed
@mnaimfaizy mnaimfaizy deleted the feat/shared-module-quizzes branch April 9, 2026 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request feature New Feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant