Commit 1f193b1
committed
feat(practice): session summary + history + weak-area + export + pause timer
A completion experience for finishing a bank, persisted history across
sessions, weak-area highlighting, exportable summaries, and a pause/resume
flow so users can step away mid-exam without losing the run.
Summary screen (when every question in the filtered bank has been
visited and at least one answered):
- Hero block: big tone-coloured percentage + correct/total + verdict
badge (PASS/BELOW for mock exams using a 70% threshold; descriptive
labels for practice mode).
- Per-module breakdown: name + ratio + progress bar tinted by the same
tone bands as the hero.
- Weak-area callout: domains scoring below 70% are surfaced as
'Focus next on these modules' so users know where to drill.
- Time stats (only when the exam timer was running): total time,
average per question. Paused time is subtracted so the figures
reflect actual effort, not wall-clock.
- Best streak metric (always shown when > 0).
- Confetti at >= 80% (live summaries only; respects reduced-motion).
History:
- Each completed session is appended to localStorage under
'dbx-practice-sessions-<cert>' (50-record ring buffer per bank).
- Summary screen shows the last six past attempts as a clickable
compact list for at-a-glance comparison.
- Stats page now lists every past attempt for the current bank with
date/time, score, fraction, duration and verdict — clicking any
row reopens that attempt's summary in read-only mode.
- 'Clear history' button on stats with confirm modal.
Export:
- HTML export: self-contained printable report with inline styles,
the same hero + breakdown + focus-areas + stats layout, downloads
as 'dbx-<cert>-<timestamp>.html'.
- CSV export: two-section sheet — metadata pairs at top, per-module
table at bottom; opens cleanly in Excel/Numbers/Sheets.
Pause / resume:
- Click the timer pill (or press P) to pause. Click again or press
Esc / Enter / Space / outside the resume card to come back.
- A backdrop-blur overlay covers the page so the questions aren't
readable while the user is away; main content gets pointer-events
none + filter:blur so accidental input is blocked.
- Paused time accumulates in STATE.totalPausedMs and is subtracted
from the session's elapsed-time figure on the summary screen.
- Pause state is reset by resetSessionState + when entering a new
bank.
Plumbing:
- show() now knows about the 'summary' section.
- renderQuiz redirects to renderSummary on completion instead of
silently looping back through the bank.
- handleKeydown skips quiz shortcuts while paused or while a confirm
modal is open; P is a global toggle when a timer is configured.
- APP_VERSION bumped to 34, styles.css to v=34.1 parent 1a2a08e commit 1f193b1
3 files changed
Lines changed: 1267 additions & 12 deletions
0 commit comments