Skip to content

Add concept quizzes and silence MDX build warnings - #4

Merged
jondmarien merged 2 commits into
mainfrom
jondmarien/site-quizzes-1763
Sep 22, 2026
Merged

jondmarien merged 2 commits into
mainfrom
jondmarien/site-quizzes-1763

Conversation

@jondmarien

@jondmarien jondmarien commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

Quizzes can be added on the desk, and the Vercel use astro:head-inject warnings are gone. This branch also includes the dark-mode navigation fix.

Quizzes

  • /quizzes lists the checks that ship with the repo and any you save in this browser.
  • /quizzes/new writes a quiz here, imports JSON, or downloads a file you can commit.
  • Drop that file in content/quizzes/your-slug.json. bun run build rejects a bad prompt, a duplicate choice, an answer index past the choices, or a lesson link that does not exist.
  • Two original samples ship with the notes: boundary checks (BSCP) and control distinctions (Security+). They are concept checks, not copied exam items.
  • Scores stay in this browser.

Saving a quiz drops empty choice boxes and keeps the radio you marked. A blank marked choice is rejected. Opening another browser-saved quiz from the hash starts that quiz fresh, and a broken hash such as #% shows the missing-quiz message.

Build warnings

Astro 7.3.3 still emits "use astro:head-inject" on every MDX propagation module. Head metadata in this version is already chosen from the ?astroPropagatedAssets module id, and Rolldown warns that it may drop the directive. The Vite config strips that leftover line. A production build no longer prints MODULE_LEVEL_DIRECTIVE for the lesson files. The upstream removal is in withastro/astro#17095 and is not in the published 7.3.3 release yet.

Theme

Moving between pages keeps the saved dark or light choice. That change is the parent commit, also opened as #3.

Checks

  • bun run build produced 78 pages with no astro:head-inject warnings.
  • bun run lint passed.
  • Browser pass: a leading blank choice keeps the marked answer, a blank marked choice is rejected, switching #alpha-check to #beta-check clears the previous result, #% shows the missing-quiz message, and /quizzes still lists both file quizzes.

Boundary checks quiz with an explanation

Open in Web Open in Cursor 

Quizzes can be JSON in content/quizzes or written in the browser. Astro 7.3 still emits a head-inject directive Rolldown warns about; propagation already uses the module id, so the build strips that leftover line.

Co-authored-by: Jon Marien <jon@chron0.tech>
@vercel

vercel Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cert-study Ready Ready Preview Sep 22, 2026 7:54am UTC

Request Review

@jondmarien
jondmarien marked this pull request as ready for review September 22, 2026 07:46

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Two correctness issues need a look before merging: the editor can save the wrong answer when a choice box is left blank, and switching between browser-saved quizzes reuses the previous quiz's progress state.

Reviewed changes — reviewed the full diff for the quiz feature and the MDX warning fix.

  • File-backed quizzes — new quizzes content collection with zod validation plus build-time checks for slug shape, distinct choices, answer bounds, and lesson-link existence.
  • Browser quiz flow — editor (/quizzes/new) with write/import/download, hash-routed local player, index page merging repo quizzes with localStorage quizzes and scores.
  • Quiz player — per-question check/explain/next flow with score persistence and JSON download.
  • MDX build warnings — Vite post-transform strips the leftover use astro:head-inject directive on astroPropagatedAssets modules only.
  • Nav and docs — header/footer quiz links, home/about copy, and README quiz authoring section.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using Muse Spark Contributor (free) | 𝕏

Comment thread src/components/react/QuizEditor.tsx Outdated
Comment thread src/components/react/LocalQuizPlayer.tsx Outdated
Comment thread src/components/react/LocalQuizPlayer.tsx Outdated
Comment thread src/pages/quizzes/index.astro Outdated
Remap the answer index after empty choices are removed, reject a blank marked choice, reset the player when the hash changes, and ignore a malformed hash.

Co-authored-by: Jon Marien <jon@chron0.tech>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

All four findings from the prior review are addressed cleanly by this delta.

Reviewed changes — reviewed commit d87f1ee against the prior pullfrog review at 2dc4dd9.

  • Fixed editor answer mapping — blank choice boxes are now dropped with the marked index remapped, and a blank marked choice is rejected with a field-level error.
  • Reset local player per quiz — LocalQuizPlayer now mounts QuizPlayer with key={quiz.id} so switching hashes starts fresh.
  • Guarded hash decoding — malformed hashes fall back to the not-found state instead of throwing.
  • Removed dead track guard — the unreachable isQuizTrack check and helper are gone from the quizzes index.

Pullfrog  | View workflow run | Using Muse Spark Contributor (free) | 𝕏

@jondmarien
jondmarien merged commit 00b95fc into main Sep 22, 2026
3 checks passed
@jondmarien
jondmarien deleted the jondmarien/site-quizzes-1763 branch September 22, 2026 07:56

This branch was successfully deployed

1 active deployment
Preview — d87f1eec Deployed Sep 22, 2026 by vercel[bot]
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