Skip to content

feat: interactive autograded starter workspace (Module 03) - #1

Open
IshmaelRogers wants to merge 1 commit into
mainfrom
feat/interactive-workspace
Open

IshmaelRogers wants to merge 1 commit into
mainfrom
feat/interactive-workspace

Conversation

@IshmaelRogers

Copy link
Copy Markdown

What this does

Converts Module 03 (Web Platform: JavaScript Foundations) from an LMS content dump into an
interactive, autograded starter workspace, mirroring the approved Module 04 reference template.
Learners open an exercise, read its README.md, implement the // TODOs in src/, run the tests, and
push — the Autograde GitHub Action reports a per-exercise score and comments it on the PR.

Structure

  • Toolchain (one root): package.json (vitest + jsdom, ES modules, plain .js), vitest.config.ts
    (Node default; DOM labs opt into jsdom per-file), scripts/grade.mjs (groups results by exercise
    folder under labs//assignments/; no tsc gate — typeGate = { ok: true }, the tests are the gate),
    .github/workflows/autograde.yml, .gitignore, rewritten root README.md, refreshed .devcontainer.
  • Removed LMS-duplicated content: Lesson_*.md, LEARNER_GUIDE.md, MODULE_SYLLABUS.md, flat
    labs/*.md + labs/README.md, assignments/README.md, and the flat capstone-brief.md (folded into
    assignments/capstone/README.md). Kept resources/, .devcontainer/, and both
    *submission-template*.md files.
  • No answer keys shipped. Each src/ is starter code with // TODOs; each tests/ is the spec.

Exercises (13 folders)

Folder Autograded core
labs/lab-00-environment analyzeResource — classify a Network entry, render-blocking + transfer size
labs/lab-01-page-load firstPaintBlockers / criticalPath over a resource list
labs/lab-02-login-form validate + initLoginForm (jsdom: selector/passing/preventDefault)
labs/lab-03-layout auditLayout — flag the four box-model bugs from CSS declarations
labs/lab-04-js-runtime fix coercion / var loop-capture / shared state / this
labs/lab-05-modernize ES6+ utils, behaviour-preserving (the || vs ?? trap)
labs/lab-06-async-eventloop eventLoopOrder; callbacks → async/await; chunk yields
labs/lab-07-data-structures joinFast (Map) + dedupFast (Set), matched against the slow versions
labs/lab-08-search binarySearch + memoize + debounce (fake timers)
labs/lab-09-http-rest fix a fetch client that treats 4xx/5xx as success (stubbed fetch)
labs/lab-10-dns-tcp parseCurlTiming + attributeSlowness to a layer
labs/lab-11-rendering layoutTriggers guard + batched-read/write scheduleUpdates
assignments/capstone integrated diagnostics toolkit across all six layers

Harness & dependencies

  • vitest ^2.1.8 + jsdom ^25.0.1 (dev only). Plain .js ES modules with JSDoc — no TypeScript,
    so the tsc type gate from Module 04's grader is dropped and the tests are the sole gate.

Verification

  • Stubs (RED): node scripts/grade.mjs16/81 tests (20%), exit 1, every exercise ❌.
    (A handful of stub defaults coincidentally satisfy negative/empty-case assertions; the suite is RED overall.)
  • Reference solution (GREEN): implemented every // TODO in a throwaway copy outside the repo →
    81/81 tests (100%), exit 0, all 13 exercises ✅. Temp copy deleted; no solutions are in this branch.

Honest notes on autogradability

These labs are DevTools/browser-investigation heavy (Network waterfalls, Performance traces, box-model
overlays, dig/ping/traceroute). Those hands-on steps can't be autograded, so each lab distills its
autogradable core — a pure function or jsdom-assertable DOM behaviour — and the README directs the
remaining investigative deliverables to the LMS notebook. The most investigation-bound labs (00, 01, 03,
10) are graded on the reasoning artifact (classify a resource, list blockers, audit declarations, parse
and attribute curl timings) rather than live tool output. Every folder still has a README, real starter
src/, and at least five passing tests.

Transform the JavaScript Foundations module into a work-along workspace:
self-contained labs/<name>/{README,src,tests} and assignments/capstone, with
vitest (Node + jsdom) as the autograder. Tests are the spec; no answer keys.

- Remove LMS-duplicated content (Lesson_*, guides, flat lab/assignment briefs).
- Add root toolchain: package.json, vitest.config.ts, scripts/grade.mjs
  (per-exercise score, no tsc gate), .github/workflows/autograde.yml, .gitignore.
- 12 labs + capstone: render-blocking analysis, login-form DOM wiring (jsdom),
  layout audit, runtime bugs, ES6+ modernization, event loop + async, Map/Set
  optimization, binary search/memoize/debounce, fetch error handling, curl
  timing attribution, layout-trigger/batched-render, and an integrated capstone.
- 81 tests; verified stubs RED (16/81) and reference solution 100% GREEN.
@github-actions

Copy link
Copy Markdown

Forge SWEXP — Module 03 autograde

Score: 16/81 tests (20%)

Exercise Tests Status
assignments/capstone 0/7
labs/lab-00-environment 4/8
labs/lab-01-page-load 1/5
labs/lab-02-login-form 4/8
labs/lab-03-layout 1/6
labs/lab-04-js-runtime 1/6
labs/lab-05-modernize 0/6
labs/lab-06-async-eventloop 0/6
labs/lab-07-data-structures 0/5
labs/lab-08-search 0/8
labs/lab-09-http-rest 2/5
labs/lab-10-dns-tcp 1/5
labs/lab-11-rendering 2/6

Keep going — open each exercise folder, implement the // TODOs in its src/, and run npm test. The tests in each tests/ folder are the spec.

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