Persist attempts used across sessions#40
Conversation
There was a problem hiding this comment.
Codex Review: Here are some suggestions.
Reply with @codex fix comments to fix any unresolved comments.
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, or 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 fix this CI failure" or "@codex address that feedback".
| if (mode === 'homework') { | ||
| updateProgress({ index: currentSentenceIndex, ok: isCorrect, revealed: false }); | ||
| if (isCorrect) { | ||
| updateProgress({ index: currentSentenceIndex, ok: true, revealed: false }); | ||
| } else { | ||
| const newAttempts = attemptsUsed + 1; | ||
| setAttemptsUsed(newAttempts); | ||
| if (progress && assignment) { | ||
| const storageKey = `ss::${assignment.id}::${studentName}`; | ||
| const newProgress = { ...progress, attemptsUsed: newAttempts }; | ||
| setProgress(newProgress); | ||
| saveProgress(storageKey, newProgress); | ||
| } | ||
| } |
There was a problem hiding this comment.
[P1] Preserve incorrect attempts in progress results
Incorrect homework submissions are no longer recorded. handleCheckAnswer now calls updateProgress only when isCorrect is true, so a wrong answer merely increments attemptsUsed and saves it without appending a Result or updating the summary. When the student moves to the next sentence, progress.results and summary.correct/reveals remain unchanged, producing a results modal and share text that omit the missed item and misreport the student’s progress. Previously every check (correct or not) updated progress, so this is a regression that hides incorrect answers from teachers.
Useful? React with 👍 / 👎.
Summary
Testing
npm testnpm run buildhttps://chatgpt.com/codex/tasks/task_e_68c821dac704832cbdd17782430440e7