Skip to content

Exams phase 3: spaced-repetition review queue at /review - #59

Open
A7med7x7 wants to merge 1 commit into
autopilot/exams-2-exam-pagefrom
autopilot/exams-3-review
Open

A7med7x7 wants to merge 1 commit into
autopilot/exams-2-exam-pagefrom
autopilot/exams-3-review

Conversation

@A7med7x7

@A7med7x7 A7med7x7 commented Nov 4, 2026

Copy link
Copy Markdown
Member

Exam phase 3 of 6 (docs/exams.md): a spaced-repetition review queue.

Stacked on #58 (exams), which is stacked on #53 (question bank). This PR targets #58's branch, so the diff shows only phase 3. Merge #53, then #58, then this one.

What students get

  • Every question they answer becomes a card: in module quizzes, in course exams (unanswered counts as wrong) and in reviews.
  • A Leitner schedule: wrong → back tomorrow; right → 2, 4, 8, then 16 days. A right answer before a card is due changes nothing, so retaking a quiz the same day can't push cards out to 16 days.
  • /review: up to 20 due questions, most overdue first, mixed across courses and topics (interleaving), options shuffled. The answer and explanation appear right after each answer, with a "Re-read" link to the lesson. Each answer is saved immediately, so leaving halfway loses nothing.
  • Header: a "Review" link with a count badge appears only when something is due, so new visitors see no extra item.
  • Dashboard: a review panel ("5 questions to review" / "all caught up, 3 more on Nov 9") once there are any cards, even without registering for a course.
  • Exam results tell students their missed questions will come back in the queue.

How it's built

  • src/lib/review.ts: pure scheduling (answer, dueIds, nextDue, boxCounts) with "today" passed in, plus storage under decoded:review:v1. Dates are the reader's local calendar days.
  • src/hooks/useReviewCards.ts: keeps the header, Dashboard and review page in sync, across tabs too.
  • src/pages/ReviewPage.tsx: lazy route at /review. It loads only the banks for the courses that have due cards, and drops cards whose question was removed from the site.
  • Quiz (in MdxComponents.tsx) and ExamPage record answers.

Tests (22 new)

  • src/test/review.test.ts: the Leitner rules, including the full ladder (2 → 4 → 8 → 16 → 16 days), wrong-resets-to-box-1, no early promotion, and overdue cards; dates across month, year and leap-day boundaries; queue ordering; storage, including corrupt data.
  • src/test/review-page.test.tsx: the empty state, a full session with instant feedback and correct rescheduling (plus a stale card dropped), "next due" when nothing is due, a quiz answer creating cards, the header badge appearing only when due, and the Dashboard panel.
  • exam-page.test.tsx now also checks that an exam puts all 20 questions into the queue.

Checked

npm run lint (0 errors), tsc (app and node), npm run test (54 files, 2,450 tests), npm run build. In a browser at 390 px, light and dark: answered a real quiz, moved the cards' due date to the past, then saw the header badge and Dashboard panel, ran a review session by keyboard, and watched the badge count down. No page errors, no horizontal overflow.

Left open

Progress export/import (progressBackup.ts) still carries completed lessons only. Whether backups should include review cards and exam attempts is noted for phase 6 (account sync).


Generated by Claude Code

Exam phase 3 (docs/exams.md). Every question answered in a module quiz,
a course exam or a review becomes a card in a Leitner system: wrong
answers come back tomorrow, right ones after 2, 4, 8 and then 16 days.
A right answer before a card is due changes nothing, so retaking a quiz
can't game the schedule.

/review runs a session of up to 20 due questions, most overdue first,
mixed across courses, with the answer and explanation right after each
one and a link to re-read the lesson. The header shows "Review" with a
count only when something is due, and the Dashboard gets a review
panel. Exam results say missed questions will come back.

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