Improve every course: hand-written quick checks for all 211 chapters and lesson fixes

Merged
SR
1mo ago
+16990-1684

Improves every course on the site: real quick checks for all 211 chapters, plus a correctness and clarity pass through the lessons.

Hand-written quick checks (the big one)

Until now every chapter's quiz was auto-drafted from its headings, with distractors pulled from other courses' headings — so a Python lesson could ask about git's HEAD. src/lib/quiz.ts called them drafts awaiting review.

  • New src/lib/quizzes/<track>.ts (one file per course, keyed by chapter slug). A chapter listed there uses its authored questions, with seeded option shuffling so server and client match; unlisted chapters fall back to the drafts.
  • 211 / 211 published chapters now have 3–4 authored questions, mostly applied (predict the output, pick the fix, compute the metric). A script confirmed every slug is covered, answers are valid indexes, and options are distinct; numeric questions were hand- or script-checked.

Lesson fixes, by course

  • Python: separate-if grade chain actually gave 95 a "C"; wrong traceback line numbers; fibonacci stepper missing 13; defaultdict(list()) raises TypeError; sys.path order; KeyError vs "fails silently"; chapter counts; predict-the-output exercises.
  • ML / Computer vision: mean-average-precision widget used the wrong AP formula (81% → 67%); husky/wolf example; backwards coefficient-size logic in feature scaling and regularisation; gradient-descent convergence claim; EU AI Act wording; colour-receptor claim; try-it exercises.
  • HTML/CSS / GitHub: .gitignore with inline comments that wouldn't work; unreadable dark-mode links; favicon paths that break on GitHub Pages subfolders; git status --short columns; reflog and git restore behaviour; add -p hunk headers.
  • Vibecoding / Roblox: missing-child errors throw immediately in Roblox (lessons and widgets said they return nil); script-placement count; per-script globals; Anchored/CanCollide and CFrame explanations.
  • Financial literacy / Health in tech: the 50/30/20 button wasn't 50/30/20; minimum-payment and deferred-interest examples; interest-free window; index-fund claims (and the simulated chart is now labelled); rollover counts. Kept general and educational.

No chapter slugs, titles or order changed; chapters.sql stays in sync.

Checks

lint, typecheck, learn:check and next build pass on top of the merged #57. Verified a lesson renders its authored quick check in the redesigned quiz. No conflicts with #58.

Review round 2 (Samanyu's requested changes)

  • More interactive Python in lessons: a TryIt block (runnable .py + one-line prompt) and 68 runnable snippets across all 31 Python chapters; 39 runnable snippets across ML and Computer Vision. Snippets are self-contained and were run to check their output.
  • HTML/CSS interactivity: WebPlayground live editor (sandboxed srcdoc preview, network blocked) in six HTML/CSS chapters, plus a full editor at /playground/web with #code= sharing.
  • Removed the "Enrol buttons open the full course on Udemy in a new tab" caption.
  • Course header: lighter mint learning-space bar; more of the light-green palette throughout.
  • Decluttered: removed the Chapters/Parts/Reading box, level bars, per-chapter minutes/levels and count-heavy headings; friendlier unlock and progress copy (progress still shows once a student starts).
  • AI Resources: remade.
  • Code Playground: redesigned UI, and a drag-and-drop ML builder (Load dataset → Split → Scale → Model → Train → Evaluate → Plot) that writes the Python live and runs it in the browser — e.g. iris + kNN scores 97.4% on held-out data.
  • Projects: new /projects with 10 guided projects (Python, Web, ML), each with steps, hints, starter code, a solution, and Open-in-playground links. Added to the nav, footer and sitemap.
  • Bot review comments: fixed across all courses; where you'd already accepted a suggestion on this branch, your wording was kept. Quiz questions are now typed as 3-/4-option tuples so an invalid answer can't ship.

This branch also contains main (incl. #58 and the performance cleanup); no decorative animation loops were reintroduced. lint, typecheck, learn:check and next build pass.

🤖 Generated with Claude Code