Commit Graph

20 Commits

Author SHA1 Message Date
a2nr 9bfecfbcab feat(student-management): sync imported progress with composite model and add inline expected format to CSV headers
- Sync imported progress (completed, scored, done, reset) to composite progress model and recompute composite_percent
- Prevent caching of /progress-report.json with Cache-Control: no-store and frontend cache-busting timestamp
- Provide inline expected format guides in exported CSV lesson headers (e.g. [completed], [<earned>/<total>], [done:<1|0>:<earned>/N])
- Support robust slug extraction from formatted headers in CSV roundtrip import with full backward compatibility
- Add example composite lesson (exercise + quiz) in examples/content/dasar/composite_test.md
- Add comprehensive unit and integration tests covering progress synchronization, header formatting, and roundtrip workflows
2026-09-08 19:01:33 +07:00
a2nr ac10692b61 feat(prereq): dukung ambang minimum (min: N%) pada prasyarat materi
Tambahkan logika ambang minimum skor (opsional) di daftar prasyarat.
Tanpa ambang, status scored berapa pun (termasuk 0/x) memenuhi syarat
(backward compatible). Dengan ambang `min: N%`, earned/total harus
melebihi ambang untuk membuka kunci materi berikutnya.

Perubahan:
- Parser bullet prasyarat mendukung suffix `min: N%` (contoh: min: 75%)
- is_prerequisite_met: completed → selalu terpenuhi; scored → terpenuhi
  kecuali di bawah ambang; not_started → belum terpenuhi
- routes/lessons.py: 3 titik kunci sekarang pakai get_missing_prerequisites
- latex_test.md: tambahkan prereq quiz_test min: 75% (demo nyata)
- examples/content disinkronkan dengan content
- Tambah test_prerequisite_logic.py (28 unit test) + 3 integration test
2026-08-17 21:57:10 +07:00
a2nr 58cb35a01a feat(quiz): tag kategori diagnostik + breakdown evaluasi/diagnostik di kuis & report guru
- Backend parser (_parse_flashcards): deteksi marker ::diagnostic di baris sendiri -> category='diagnostik' (default evaluasi), strip dari tampilan.
- Persistensi: kolom answers_json (migration 0003) simpan ringkasan per-soal {question_id, selected_option_id, is_correct, category}.
- quiz_attempts: validasi/serialize answers_json + endpoint GET /quiz-attempts/<lesson> untuk review-after-refresh.
- quiz-session: hitung evalCorrect/evalTotal/diagCorrect/diagTotal/diagUnmastered; skor resmi = evaluasi saja.
- Frontend: QuizTab badge per-soal + breakdown 'Belum dikuasai'; progress guru tampil badge Eval/Diag per lesson.
- Content: pindahkan ::diagnostic ke baris sendiri (fix kerusakan fenced code/blockquote dari edit sebelumnya).
- Tests: unit parser kategori + payload answers.
2026-08-15 09:33:23 +07:00
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
a2nr e0324a77c0 add example content 2026-07-27 22:14:45 +07:00
a2nr 8e89fde3c1 fix: docked editor panel height + quiz image parser + assets dir config
- fix(layout): editor-area docked mode sekarang height:70vh (sebelumnya
  max-height:85vh tanpa height, menyebabkan tab Arduino/velxio menciut
  ke 150px karena iframe tidak punya intrinsic height)
- fix(layout): tambah overflow:hidden pada velxio/flowchart/quiz panel
  untuk mencegah nested scrollable flex collapse
- feat(quiz): parser image dari 'image:' directive dan markdown ![alt](path)
  di question flashcard; konversi bare filename ke /assets/ path
- feat(assets): ASSETS_DIR derived dari CONTENT_DIR untuk support
  custom content directory (bukan hardcoded 'assets')
- fix(quiz): QuizTab container gunakan flex:1+min-height:0 (bukan height:100%)
- chore: hapus placeholder examples/assets/put_your_image.here
2026-07-21 20:50:01 +07:00
a2nr 2a09ee77ab feat(embed): add raw HTML embed fence with bleach sanitization
- Add embed markdown fence: user pastes raw embed HTML code
  (from Canva/YouTube/Google Docs Share→Embed) into lesson markdown
  and slide content. Backend sanitizes via bleach (whitelist
  tags/attrs/styles) + checks iframe src against domain blacklist
  (SSRF prevention). Frontend renders iframe directly — no lazy
  action needed.
- Backend: _process_embed_embeds + _sanitize_embed_html in
  lesson_service.py, applied to lesson_content, exercise,
  lesson_info, and slide loop. Graceful fallback if tinycss2
  missing (CSS unsanitized but tags/attrs still stripped).
- Tests: 9 pytest cases (Canva/YouTube HTML, script stripping,
  onclick stripping, blocked domain, non-https iframe, empty,
  unchanged, dangerous style).
- Frontend: remove renderEmbedEmbeds.ts + wire-up + .generic-embed
  CSS (URL-only approach from earlier iteration, superseded).
  Keep .embed-error CSS for error messages.
- Example: update test_slides.md with raw HTML Canva embed (slide)
  + YouTube embed (body).
- Deps: bleach>=6.0.0, tinycss2>=1.2.0 in requirements.txt.
- Docs: consolidate 4 plan files into docs/06-embed-content.md.
2026-07-19 15:39:38 +07:00
a2nr d6bb2073ac feat: add markdown link support for lesson prerequisites
- Update lesson_service.py to parse markdown link format [title](path)
- Convert all lesson files to use markdown link format for prerequisites
- Backend now extracts slug directly from link path
- Supports both plain text and markdown link formats
2026-07-18 07:31:10 +07:00
a2nr bc49877123 feat: update to support folder inside content folder to easy to manage 2026-05-14 19:45:10 +07:00
a2nr 097f2c5609 feat: enhance lesson UI with centered images, bordered tables, and conditional output tab 2026-05-11 07:27:15 +07:00
a2nr 60469925ea docs: update README and documentation with quiz features, add example quiz and flowchart lessons 2026-05-10 09:39:17 +07:00
a2nr 459ceff2d8 fix: prevent localStorage leakage and fix navigation by implementing component isolation and reactive state management 2026-05-10 09:14:00 +07:00
a2nr c5348a9166 add feature: flowchart maker 2026-05-01 09:09:45 +07:00
a2nr f8de0cab5f feat: implement \"Coba\" button for code blocks
and improve mobile UX

   - Menambahkan fitur tombol \"Coba ▶\" untuk menyalin kode
     materi ke editor secara otomatis.
   - Implementasi setupTryButtons.ts (Svelte Action) untuk
     injeksi tombol berdasarkan label bahasa Markdown (c, python,
  `arduino).
   - Mengatur perilaku tombol agar hanya memuat kode dan
     memfokuskan tab (No Auto-Run) untuk memberikan kesempatan
     siswa meninjau kode.
   - Optimasi tampilan Mobile (< 768px):
       - Tombol \"Coba\" selalu terlihat (tanpa hover).
       - Otomatis membuka workspace ke mode 'half-sheet' dan
         melakukan smooth scroll ke editor saat tombol diklik.
   - Sinkronisasi urutan render: setupTryButtons dijalankan
     sebelum highlightAllCode untuk memastikan deteksi bahasa
     yang akurat.
   - Update documentation.md dengan panduan penggunaan fitur
     tombol \"Coba\" dan dokumentasi refactoring modularitas
     halaman lesson.
   - Menambahkan modul uji coba LaTeX ke daftar materi di
     home.md
2026-04-27 21:38:36 +07:00
a2nr 7c069660f6 feat: add evaluation configuration support in lesson content and API 2026-04-16 11:12:23 +07:00
a2nr 7acce0b610 refactor: update component wiring and properties in Arduino examples 2026-04-16 08:00:54 +07:00
a2nr 10548b1f51 feat: add Arduino lesson support, documentation, and load testing utilities with improved CLI feedback 2026-04-11 08:39:57 +07:00
a2nr 997ab78f56 feat: improve evaluation system and update circuit editor to use localStorage for persistence 2026-04-10 14:00:35 +07:00
a2nr 0e944e5224 feat: Add Python version examples and explanations for Hello World, Voltage Divider, and Variables lessons 2026-04-01 10:50:19 +07:00
a2nr 3771f01110 feat: Add initial configuration files, example content, and lesson materials for programming and circuit in Elemes LMS 2026-04-01 09:37:09 +07:00