Skip to content

Persist attempts used across sessions#40

Closed
abocha wants to merge 2 commits into
mainfrom
codex/add-attempts-used-tracking-to-storage
Closed

Persist attempts used across sessions#40
abocha wants to merge 2 commits into
mainfrom
codex/add-attempts-used-tracking-to-storage

Conversation

@abocha

@abocha abocha commented Sep 15, 2025

Copy link
Copy Markdown
Owner

Summary

  • Track attempts used for the active homework item and reset after completion
  • Persist attemptsUsed in localStorage so users can't bypass remaining-tries limits
  • Default missing attemptsUsed to 0 when loading old progress

Testing

  • npm test
  • npm run build

https://chatgpt.com/codex/tasks/task_e_68c821dac704832cbdd17782430440e7

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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".

Comment thread components/GameApp.tsx
Comment on lines 314 to +326
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);
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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 👍 / 👎.

@abocha abocha left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codex fix comments

@abocha abocha closed this Sep 17, 2025
@abocha
abocha deleted the codex/add-attempts-used-tracking-to-storage branch September 17, 2025 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant