Commit Graph

30 Commits

Author SHA1 Message Date
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 e4ec3f1ded feat: custom evaluation config 2026-06-17 20:34:36 +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 58e897f743 feat: add markdown-based interactive slide carousel with fullscreen mode 2026-05-14 18:53:46 +07:00
a2nr 7384b6e585 feat: readable content: 2026-05-14 16:26:11 +07:00
a2nr be534f3512 fix: robust lesson parsing for flexible home.md formats 2026-05-11 11:35:28 +07:00
a2nr 438d96ef13 feat: update image capability inside quiz 2026-05-10 20:38:35 +07:00
a2nr ea3556d05f feat: implement interactive quiz with secure content protection, scoring, and teacher reset 2026-05-09 13:04:42 +07:00
a2nr 7e77748b6b feat: add quiz feature 2026-05-08 09:50:07 +07:00
a2nr 9ed207d2fa feat: implement secured lesson prerequisite system with interactive links and auto-docking UI 2026-05-07 10:54:42 +07:00
a2nr 2b6ec21633 perf: fix race conditions with file locking and optimize backend latency 2026-05-05 22:57:19 +07:00
a2nr c103bc02ad feat(flowchart): support interactive embedding in markdown with readonly mode and frontend evaluation 2026-05-02 19:45:04 +07:00
a2nr 433c095394 feat(flowchart): implement text-based logic with auto-layout and migrate evaluation to frontend 2026-05-02 18:47:46 +07:00
a2nr 0ff56ed9d2 bug fix : leak content python_expected_output 2026-05-01 15:32:55 +07:00
a2nr c5348a9166 add feature: flowchart maker 2026-05-01 09:09:45 +07:00
a2nr 5aebd4487d refactor(frontend): pecah komponen raksasa
+page.svelte dan perbaiki backend parser

Pembaruan ini
     mencakup:
- Refactoring skala besar pada halaman lesson SvelteKit untuk efisiensi kode.
- Ekstraksi evaluasi Code, Circuit, dan Velxio ke dalam direktori lib/services/.
- Memisahkan manajemen iframe (Zustand & PostMessage) ke  velxio-manager.ts.
- Memisahkan Tab Panel HTML menjadi komponen spesifik (CodeTab, CircuitTab, VelxioTab).
- Ekstraksi blok <style> menjadi stylesheet terpisah (lesson.css).
- Perbaikan warning A11y & penghapusan class usang pada Navbar.svelte.
- Memperbaiki regex parser 'Available_Lessons' pada lesson_service.py di backend.
- Menambahkan mekanisme auto-append ekstensi '.md' untuk  mengatasi bug Home kosong dan tombol 'Next Lesson' yang hilang akibat format URL baru di home.md.
2026-04-27 13:36:17 +07:00
a2nr b8fb67115e feat: implement LaTeX support with KaTeX and python-markdown-math
3 - Integration of KaTeX in frontend (SvelteKit) with a custom
  renderMath` action.

  - Added `python-markdown-math` extension in backend (Flask). to handle math blocks.
  - Configured Vite to handle KaTeX during SSR and browser rendering.
  - Added a LaTeX test lesson and updated home navigation.
  - Supported both inline ($) and block ($$) math rendering,
   including multi-line support.
2026-04-26 15:47:11 +07:00
a2nr dc1d65ac15 remove blacklist logout feature 2026-04-22 16:56:02 +07:00
a2nr e4c68b2894 feat(security): implement anonymous access with rate limiting and secure proxy, harden authentication and implement session protection
Implements multiple layers of security to address high-risk session
   and authentication vulnerabilities identified in the security review:

   - Allow code compilation (C, Python, Arduino) for anonymous users.
   - Enforce a 1-request-per-2-minutes rate limit for anonymous IPs.
   - Implement a global anonymous compilation queue with 20 concurrent slots.
   - Proxy Velxio (Arduino) compilation through Flask to prevent API hijacking.
   - Exempt authenticated users (tokens/cookies) from all rate limits.
   - Fix networking and DNS resolution in podman-compose.
   - Fix Svelte a11y warnings and trailing slash routing issues.
   - Cookie Security: Added dynamic 'secure' flag support via COOKIE_SECURE
     env variable for HTTPS/Tailscale Funnel compatibility.
   - Rate Limiting: Integrated Flask-Limiter on /login (50 req/min) to
     prevent API abuse while accommodating shared school networks (NAT).
   - Tarpitting: Added 1.5s artificial delay on failed logins to neutralize
     automated brute-force tools without blocking legitimate users.
   - Session Invalidation: Implemented an in-memory token blacklist on
     logout to ensure session tokens cannot be reused.
   - Documentation: Updated technical docs and proposal status to reflect
     the current security architecture.

   Ref: @elemes/proposal.md (Poin 6.1, 6.2, 6.3)
2026-04-22 12:57:54 +07:00
a2nr 7c069660f6 feat: add evaluation configuration support in lesson content and API 2026-04-16 11:12:23 +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 74a8d87853 add velxio as submodule 2026-04-09 10:51:36 +07:00
a2nr 1e6c6a884c feat: Enhance lesson functionality with circuit output and key text support, update token generation script for better CSV handling 2026-03-31 14:31:15 +07:00
a2nr d29c2f2e3e feat: Integrate CircuitJS1 into Elemes LMS
- Added CircuitJSApi interface for simulator API interaction.
- Updated lesson page to support circuit simulation alongside code execution.
- Implemented separate output states for code and circuit evaluations.
- Enhanced lesson content rendering to include circuit embeds using markdown.
- Refactored backend to process circuit embed syntax and convert to HTML.
- Updated podman-compose configuration to include new environment variable for cursor offset.
- Created a proposal document outlining the feasibility and implementation plan for CircuitJS1 integration.
2026-03-31 12:08:42 +07:00
a2nr 39d1b18c2a feat: integrate circuitjs1 simulator into frontend with new editor component and service worker support 2026-03-29 17:25:09 +07:00
a2nr 0528df2d37 refactor: optimize performance with lru_cache, update gunicorn to gthread 2026-03-28 20:09:09 +07:00
a2nr d3acfcf825 update green check, button start, de-overwhelm +page, improve mobile ui, add progress page for teacher only, add sessionStorage. 2026-03-27 16:41:57 +07:00
a2nr d2b6d62b28 refactor to make it better 2026-03-25 09:39:51 +07:00