Adaptive player: panels, questions, saved progress - #75364
Closed
lfryemason wants to merge 3 commits into
Closed
lfryemason wants to merge 3 commits into
lfryemason wants to merge 3 commits into
Conversation
lfryemason
added this pull request to stack #75365
September 17, 2026 18:00
Byte-for-byte copies from sanchit/hackathon, moved from apps/src/aiLessons
into apps/src/adaptive with no other edits, so the next commit's diff
shows exactly what the Adaptive port keeps and drops:
aiLessons/QuestionFlow.tsx -> adaptive/QuestionFlow.tsx
aiLessons/types.ts -> adaptive/types.ts
aiLessons/studentInputs.ts -> adaptive/studentInputs.ts
aiLessons/aiLessons.module.scss -> adaptive/adaptiveView.module.scss
test/unit/aiLessons/QuestionFlowTest.tsx
-> test/unit/adaptive/QuestionFlowTest.tsx
This commit does not build: the copied files import hackathon modules
that were not brought over. Lint is skipped for the same reason.
Turn the Adaptive scaffolding into a working Lab2 player for the content format in types.ts: a lesson is a list of steps played in array order, with `next` to jump or end early. Two step kinds so far, panels (captions with optional images) and question (multiple choice, one at a time, optionally multi-select, graded when any option is marked correct). Cut the hackathon question flow down to what Adaptive needs. Gone are free response, scale questions, branch options, recommendations, the LLM judge, and the StudentInputs wrapper; AnswerRecord moves into types.ts and keeps only the fields the player writes. The stylesheet keeps the question and pill button rules and drops the rest of the hackathon page. Player state (position, path, completed steps, answers, finished flag) lives in an RTK slice. It saves on every step completion through /user_levels/adaptive_state and restores on load; nothing is saved when the level is viewed outside a unit. Completing a step posts an attempted result through the Lab2 milestone path, and the last step hands off to the standard continue flow, which posts ALL_PASS. sample.json gains a question step exercising every option shape.
A graded question with dontKnowEnabled shows an "I don't know" button next to Next. Choosing it records an answer with the new dontKnow outcome, which is a failure like incorrect and keeps whatever the student had selected, then tints every correct option green, any wrong selection red, and names the correct answer in a status line so the reveal does not rest on color alone. The options lock and Next simply advances, so a dontKnow cannot be turned into a correct after seeing the answer. Ungraded questions ignore the flag. sample.json turns it on for the paragraph question.
lfryemason
force-pushed
the
lc/adaptive-player
branch
from
September 17, 2026 18:02
957562a to
fbd86f3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Frontend half of the Adaptive player. Stacked on #75363 (the state save routes) and #75305 (the level type scaffolding).
Turns the Adaptive scaffolding into a working Lab2 player for the content format in
apps/src/adaptive/types.ts. A lesson is a list of steps played in array order, withnextto jump or end early. Two step kinds so far:panels: a sequence of captions, each with an optional image.question: multiple choice, one question at a time, optionally multi-select. A question with any option markedcorrectgates progression until the chosen set matches exactly; one with none records the answer and moves on.dontKnowEnabledadds an "I don't know" button that records adontKnowfailure, reveals the correct options, and lets the student continue.Player state (position, path, completed steps, answers, finished flag) lives in an RTK slice. It saves on every step completion through the routes in #75363 and restores on load. Nothing is saved when the level is viewed outside a unit. Completing a step posts an attempted result through the Lab2 milestone path, and the last step hands off to the standard continue flow, which posts
ALL_PASS.apps/src/adaptive/README.mddocuments the content format and state handling.Commits
Review commit by commit. The first is a byte-for-byte copy so the second shows exactly what was kept from the hackathon.
sanchit/hackathon, moved fromapps/src/aiLessonsintoapps/src/adaptivewith no edits:QuestionFlow.tsx,types.ts,studentInputs.ts, the stylesheet, and the QuestionFlow test. This commit does not build on its own, since it imports hackathon modules that were not brought over. Only the PR head runs in CI.StudentInputswrapper from the question flow; keeps the question and pill button styles and drops the rest of the hackathon page. AddsPanelsStep, the redux slice, the progress API client, theAdaptiveViewwiring, and tests.sample.jsongains a question step exercising every option shape.Links
sanchit/hackathonTesting story
Unit tests under
apps/test/unit/adaptive/:QuestionFlowTest.tsx(11 tests: ungraded and graded flow, multi-select grading, attempt counting, progress dots, and the dontKnow paths),adaptiveReduxTest.ts, andtypesTest.ts. Run with:Typecheck and lint pass on the PR head. Not yet played through in a browser on this branch: the
adaptive-devunit withsample.jsonis the place to do that, checking that state restores on reload, wrong answers shake and block, and "I don't know" reveals and continues.