forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on mainFiltered to src/lib/exam-status.test.tsClear filter

2026-07-23

fix: 🐛 keep active students in_progress on the live monitorAhmet Kaan Gümüş · bc3b5ce
fix: 🐛 keep active students in_progress on the live monitor

The teacher live monitor mislabeled a student actively sitting the exam
as `no_attempts_left` whenever `attempts_used >= max_attempts`. Because
`attempts_used` counts the running sitting, every in-progress student on
a single-attempt exam (the common case) rendered as `no_attempts_left`
instead of `in_progress` — the roster looked empty of live activity.

Only `in_progress` entries ever reached that branch (absent/not_started
return earlier, submitted/expired are guarded), so it was always wrong.
The student's own view already guarded `status !== "in_progress"`; the
monitor helper did not.

Extract `liveDisplayStatus` into lib/exam-status.ts (testable, matches
examDisplayStatus), drop the bad branch, and cover it with regression
tests: active-final-attempt stays in_progress, walkout still resolves to
left / no_attempts_left, terminal statuses pass through.

2026-07-22

refactor: ♻️ unify exam status label mapping into examStatusMessageKey - extract repeated status→i18n key switch into shared function - fix no_attempts_left logic: submitted/expired must short-circuit before attempt-count check - replace inline if/else chains in exam-card, exam-detail, and exams-page - add unit tests for examDisplayStatus and examStatusMessageKeyBurak Boduroğlu · 57b96ff
refactor: ♻️ unify exam status label mapping into examStatusMessageKey
- extract repeated status→i18n key switch into shared function
- fix no_attempts_left logic: submitted/expired must short-circuit before
  attempt-count check
- replace inline if/else chains in exam-card, exam-detail, and exams-page
- add unit tests for examDisplayStatus and examStatusMessageKey