fix: keep Learning Lab completion evidence-valid - #8
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65e143b889
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| function isLessonComplete(lesson) { | ||
| if (!lesson || !state.completed.includes(lesson.id)) return false; | ||
| return lesson.learningLab ? labReady(lesson).ready : true; |
There was a problem hiding this comment.
Apply evidence-valid completion to the validation gate
For legacy learners whose stored completed array contains both M01 lesson IDs but whose new lab evidence is absent, this helper correctly makes the course treat those lessons as incomplete, while m01-validation-app.js:isStudied() still checks only the raw flags. After answering its two separate drills, validationView() therefore unlocks the post-case and labels the learner studied despite neither Learning Lab being complete, allowing stale flags to contaminate the experiment this change is intended to protect.
Useful? React with 👍 / 👎.
| const next = allLessons[index + 1]; | ||
| const checked = state.criteria[id] || []; | ||
| const done = state.completed.includes(id); | ||
| const done = isLessonComplete(lesson); |
There was a problem hiding this comment.
Refresh completion UI when required evidence is removed
When a completed Learning Lab is open and the learner clears a required workbook field, the input handler saves the invalid evidence and the sidebar immediately drops the completion, but done remains this render-time snapshot. The lesson header consequently continues to say completed and the primary action remains a link to the next lesson while the status says required evidence is missing; rerender or update the completion-dependent controls when lab readiness changes.
Useful? React with 👍 / 👎.
Purpose
Prevent stale legacy completion flags from bypassing the current Learning Lab evidence contract.
Confirmed defect
A learner who completed an M01 lesson before Learning Lab was introduced could still see the lesson/module/course as completed even with zero required drills/workbook evidence.
Fix
isLessonComplete(lesson)donestatusTDD
RED: CI #105 (
34123025174) — 32/34 pass, 2 expected failures reproducing stale completion.GREEN: CI #110 (
34123563102) — 34/34 pass, 0 failures on65e143b889730f3db933a677a6130abe58675d14.Scope
Only
app.jsplus one regression test. No content, router, CSS, telemetry, main, or M02 activation changes.