elemes/docs
a2nr 02d5969619 refactor(quiz): restructure quiz session, question view, and tab safety
Restructure quiz flow into QuizSession primitive + atomic quiz state in
LessonManager, and extract QuizQuestionView for split-view display.

Tab-safety fix: add lesson-tabs.ts with pickDefaultTab(), getAvailableTabs()
mirroring the exact {#if} conditions in +page.svelte, and ensureActiveTab()
safety-net that falls back to pickDefaultTab() when the desired tab is not
rendered. A reactive $effect in lesson/[slug]/+page.svelte validates
activeTab against lesson data on every change, preventing the "tab quiz
kosong" (empty workspace) regression for quiz-only lessons and phantom-tab
state after data changes.

Files:
- lib/services/lesson-tabs.ts (+test): pure helpers, 18 tests pass
- lesson/[slug]/+page.svelte: ensureActiveTab reactive guard + QuizQuestionView
- lesson/[slug]/lesson.svelte.ts: atomic startQuiz, getExitStatus, idempotent
  submit on navigate/exit
- lib/services/quiz-session.ts (+test), lib/types/quiz.ts, QuizTab.svelte
  (mgr-driven), QuizQuestionView.svelte, lesson.css
- services/lesson_service.py, services/tests/test_lesson_service_quiz.py
  (test_lesson_service_quiz.py), requirements.txt (+pytest)
- docs/07-quiz-authoring.md
- version.ts APP_VERSION 21 -> 22 (forces SW update for the fix)
- examples/content/dasar/quiz_test.md synced to live content root
2026-08-01 00:14:29 +07:00
..
01-architecture-setup.md add : docomentation 2026-05-14 16:33:45 +07:00
02-backend-flask.md add : docomentation 2026-05-14 16:33:45 +07:00
03-frontend-sveltekit.md add : docomentation 2026-05-14 16:33:45 +07:00
04-lesson-evaluation.md docs: add slide tutorial for teacher 2026-05-14 19:04:24 +07:00
05-velxio-ble-deployer.md docs(usb-deployer): document v3.2 get_sync fix (timing, drain, fail-fast) 2026-07-19 16:54:19 +07:00
06-embed-content.md feat(embed): add raw HTML embed fence with bleach sanitization 2026-07-19 15:39:38 +07:00
07-quiz-authoring.md refactor(quiz): restructure quiz session, question view, and tab safety 2026-08-01 00:14:29 +07:00