Skip to content

Add per-Slack-user lesson completion tracking and refactor flowchart lessons (1–4) - #30

Merged
tytremblay merged 3 commits into
mainfrom
feat/lesson-completion-tracking
Nov 25, 2026
Merged

tytremblay merged 3 commits into
mainfrom
feat/lesson-completion-tracking

Conversation

@tytremblay

@tytremblay tytremblay commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  1. Per-Slack-user lesson completion tracking backed by SQLite (node:sqlite, zero extra runtime dependencies) in hawk-learn.
  2. Refactored Lessons 1–4 into an imperative Flowchart & Execution Tracer (FlowchartPlayground) that visually demonstrates sequential execution, branching, looping, and function calls with FRC robotics scenarios (while keeping BlockPlayground untouched for Lessons 28 & 32).

Before & After Screenshots

Lesson Index & Completion Tracking

Before (main) After (this PR)
Before Index After Index

Lesson 1 — Programs are step-by-step

Before (main) After (this PR)
Before Lesson 1 After Lesson 1

Lesson 2 — Making decisions

Before (main) After (this PR)
Before Lesson 2 After Lesson 2

Lesson 3 — Doing things over and over

Before (main) After (this PR)
Before Lesson 3 After Lesson 3

Lesson 4 — Reusable blocks (Functions)

Before (main) After (this PR)
Before Lesson 4 After Lesson 4

Lesson Completion Tracking

  • Persistence (server/progress-db.mjs): SQLite database in WAL mode with users and lesson_completions tables stored in DATA_DIR (/data/progress.db in production, .data/progress.db locally).
  • API (server.mjs): GET /api/progress and POST /api/progress ({ lessonSlug, completed }), authenticated via Hawk Suite proxy headers (x-hawk-slack-user, x-hawk-slack-team), with read-only Slack display name resolution.
  • Deployment (.hawk/app.json, Dockerfile, docker-compose.dev.yml, scripts/deploy-check.mjs): Declares "data_dir": "/data", configures /data permissions, and mounts a persistent volume in dev compose.
  • UI (site/src/lib/progress.tsx, App.tsx, AppSidebar.tsx, LessonIndex.tsx, LessonCard.tsx, LessonView.tsx): Overall & per-section completion counts, green checkmarks on completed lessons, and a Mark lesson complete toggle in LessonView.

Flowchart Lessons Refactor (Lessons 1–4)

  • Imperative Execution Engine (site/src/lib/flowchartEngine.ts): Step-by-step control-flow tracer from START to END with live memory, local function scope, call stack, per-node error steps, synced Python 3.12 codegen, and automated challenge checks.
  • Interactive Flowchart UI (site/src/components/FlowchartPlayground.tsx, FlowchartPlayground.css):
    • True directional arrowheads, SVG IF decision diamond with fork/merge connectors and full untaken-branch skipping, REPEAT loop with curved loop-back arrow and pass counter, and live-animated side-by-side reusable function cards.
    • Drag-and-drop (plus click-to-add, explicit + YES / + NO buttons, reorder, and delete) structured flowchart builder with Run / Pause / Back / Step / Clear run / 1×–2× speed / Start over / Peek at Python / Check.
  • FRC Robotics Scenarios (site/src/lib/flowchartPresets.ts, lessons/01–04/README.md): Autonomous coral scoring, battery brownout limiter & shooter range check, smooth motor ramp-up & flywheel spin-up loop, and reusable robot scoring/speed functions (with editable function body in Lesson 4).

Testing

  • node --test server/test_progress.mjs (2/2 passing)
  • node scripts/deploy-check.mjs --contract & env validation
  • cd site && npm run lint && npm run build (0 lint errors, clean TypeScript + Vite build)
  • End-to-end HTTP smoke test against server.mjs with HAWK_SUITE_TRUST_PROXY=true
  • 3 rounds of independent curriculum/pedagogy review iterating from 5/4/5/5 → 8/8/8/8 → 9/9/9/9 across Clarity, Correctness, Ease of Understanding, and Appropriateness for 14–15yo FRC students.

@tytremblay tytremblay changed the title Add per-Slack-user lesson completion tracking Add per-Slack-user lesson completion tracking and refactor flowchart lessons (1–4) Nov 25, 2026
@tytremblay
tytremblay merged commit 1d6a9cd into main Nov 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant