Skip to content

Exams phase 1: move quiz questions into a question bank per course - #53

Open
A7med7x7 wants to merge 1 commit into
mainfrom
autopilot/exams-1-question-bank
Open

A7med7x7 wants to merge 1 commit into
mainfrom
autopilot/exams-1-question-bank

Conversation

@A7med7x7

@A7med7x7 A7med7x7 commented Nov 3, 2026

Copy link
Copy Markdown
Member

Exam phase 1 of 6 (docs/exams.md): the question bank. No visible change on the site.

What changed

  • src/lib/questions.ts: the Question type and questionsForQuiz().
  • 11 new src/content/<course>/questions.ts files hold all 259 quiz questions that were written inline in 33 quiz .mdx files.
  • Each quiz file now reads questions={questionsForQuiz(questions, "<quiz-slug>")} instead of a long inline array.
Course Questions
Discrete Mathematics 42
Computer Graphics 32
Computational Mathematics, Data Structures, Logic Design 28 each
Computer Networks 27
Theory of Computation 26
Algorithm Design and Analysis 16
Computer Architecture 12
Computer Organization, Microprocessors 10 each

How it was done safely

  • Moved by script, not by hand. A one-off test compared every bank entry with the original inline question: prompt, options, right answer, explanation and order are identical.
  • Ids are <course>/<quiz-slug>/q<n> (e.g. computer-networks/foundations-quiz/q1). Review history will be keyed by these, so they're permanent from now on.
  • For these 259 questions only the quiz is known, not the specific lesson that teaches each one, so lesson is left empty rather than guessed. Filling it in is added to phase 4. docs/exams.md is updated to match.

One side effect, handled

The search index used to scrape quiz text out of the .mdx. scripts/og/generate.mjs now adds each quiz's prompts and explanations from the bank, so searching for words in a quiz question still finds the quiz (checked in the built search-index.json).

Tests

src/test/question-bank.test.ts (6 tests): no question lost (≥ 259), ids unique site-wide and well formed, exactly one right answer among distinct options plus an explanation, every quiz/lesson reference exists in its own course, every quiz lesson is fed from the bank, and no quiz file still has inline questions.

Checked

npm run lint (0 errors), tsc (app and node), npm run test (49 files, 2,259 tests), npm run build. In a browser, three quizzes (6, 14 and 10 questions) render the same number of questions and show explanations after answering, with no page errors.

Next phase (stacked on this branch if it isn't merged yet): the course exam page.


Generated by Claude Code

Exam phase 1 (docs/exams.md). The 259 questions written inline in 33
quiz files now live in src/content/<course>/questions.ts, typed by
src/lib/questions.ts, so exams and review can draw on them later.
Quizzes read their questions with questionsForQuiz(); wording, options,
answers, explanations and order are unchanged (checked against the
originals). Ids are <course>/<quiz>/q<n> and are permanent.

The search index used to read quiz text from the MDX; it now reads it
from the bank. New tests check ids are unique and well formed, every
question has one right answer and an explanation, every reference
exists, and every quiz is fed from the bank.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EC6Zzt5akQu7TEHdGquZzp

This branch has not been deployed

No deployments
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.

2 participants