Repository navigation
Quiz mode - #46
Quiz mode#46
Conversation
Enter Quiz from the new segmented mode switch in the top bar. Entering snapshots the Explore scene, lays the arch out on the phase-2 board and shows only the 32 tooth shells; names, FDI numbers, hover and detail stay hidden until an answer is submitted. A shuffled round asks one tooth at a time: select on the board, submit, read the localised name and FDI, then next. Hints are type-level, sourced and marked draft. Restart is available at any time and on the completion screen, and Exit restores the scene that was active before Quiz. The session (order, answers, hint, index) lives in sessionStorage and resumes on re-entry; Restart clears it. modes/modes.ts registers a tooth-only visibility filter for Quiz and disposes it on exit; the filter is a no-op outside Quiz, so the force-exit paths (search, guided tour, reset) cannot leak it. Camera controls stay enabled while the exploration shortcuts that reveal names or change the scene are disabled. The laid-out board now packs and frames inside the UI-clear viewport (container minus the current insets), so it sits clear of the quiz card and above the mobile sheet instead of behind them. All quiz strings are localised in the five languages. Adds unit tests for the session, the filter and the store transitions, and updates the README roadmap plus the architecture and feedback docs.
The quiz header packed the title, progress, score, restart and exit into one 272px row, so the title text ran over the progress pill. Split the header into two rows (title + actions, then the progress and score pills) and widen the card to 320px, with the title truncating rather than colliding when a language's labels are long. The body gets slightly more padding and spacing. The desktop card is now fed to the viewport insets as a left sidebar, so the board is packed and framed clear of it (it was only measured as a bottom sheet on compact layouts).
|
@Zwee42 is attempting to deploy a commit to the Yoseph's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Great work; some pointers before this can be implemented into main.
Potential future improvements: When guessing a tooth right the tooth flies into an empty skull with no teeth, so you can see the teeth starting to build up in the new skull mouth Thank you for your contribution. |
A review pass on the quiz branch asked for four things, all in this pass. Shuffle positions re-permutes the 16 upper and 16 lower board slots on every round, with an on/off switch on the card. The session stores the slot order, the store carries it as `quizBoardOrder`, and `layoutBoard` swaps each tooth's reading rank (`archOrder`) for its shuffled one (`shuffledRanks`). The two arches keep their own rows, so a tooth can only take a slot of its own arch and two never share one. Show answer extends hint mode: a revealed question counts as answered so you can move on, but never as correct, so the score is untouched. The session format becomes `ds.quiz.session.v2`. The question moved out of the card into a large top-centre prompt, fed to the engine as a viewport inset so the board is framed below it. It is a polite live region, and keyboard focus moves to Next after answering. The quiz dock keeps the camera and adds answer-safe inspection: the surface-feature overlay and a section plane act on the tooth picked on the board. `refreshClip` scopes the clipping planes per mesh and `layersActive` swaps only that tooth's shell for its tissues, so the rest of the board stays laid out. The tools wait for a picked tooth, and no name or FDI number shows before an answer is submitted. The short-landscape layout shrinks the prompt and caps the card so the two never collide. Unit tests cover the session, board order, layout and visibility; desktop, compact, landscape and reduced-motion browser checks pass, as do typecheck, lint and the production build.
CI runs `tsc -p tsconfig.eslint.json` over the tests, which the app build's project references skip. The score test built a QuizProgress literal by hand and missed the fields the session gained. Reuse the finished fixture instead, so the literal survives future session fields.
The hover tooltip names the tooth and its FDI number. It was hidden with CSS in Quiz mode but still announced to assistive technology, so the engine now skips it entirely while a quiz is running. Picking a tooth wrote /tooth/<n>/ to the address bar, which revealed the number before submitting. The router keeps the bare site address in Quiz mode, and Back/Forward leaves the quiz instead of selecting a tooth from history.
- Group the dock's Section and Surface features toggles in one row and keep the quiz card above the dock, so it no longer covers Submit. - Phones: move the Explore/Quiz switch from the top bar (where it covered the title) to the bottom bar, put Show answer beside the toggles and drop the dock tip so the board keeps more height. - Pick a tooth by board position from a select in the card, for keyboard and screen-reader users. Options name only a position. - After a wrong answer, show the picked tooth as well as the correct one. - Don't auto-start the first-visit guide over a quiz that was entered while the scene was still loading. - New strings in all five languages.
Browser tests cover a full round without revealing the answer (address bar, tooltip), Back leaving the quiz, and the card's Submit button and the phone title staying uncovered, on desktop and phone. Docs no longer refer to quiz-mode/learn-mode branches, the owner's scope note keeps its original wording with one short update line, and the new quiz files end with a newline.
A small "New!" card with an arrow sits below the Quiz button in the top bar (above it in the phone bottom bar). It opens the quiz; closing it or entering the quiz hides it for good, saved per viewer in localStorage. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the section open, the picked tooth shows its tissues. Clicking one selected that tissue (e.g. enamel-36), which hid the tissues and brought the cut shell back. In Quiz a click on any part of a tooth now selects the whole tooth, so the section stays as it was. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged to main for now! Under Beta review. |
No description provided.