Skip to content

feat: expand progress tracking types#38

Merged
abocha merged 3 commits into
mainfrom
codex/update-assignmentoptions-and-summary-interface
Sep 15, 2025
Merged

feat: expand progress tracking types#38
abocha merged 3 commits into
mainfrom
codex/update-assignmentoptions-and-summary-interface

Conversation

@abocha

@abocha abocha commented Sep 15, 2025

Copy link
Copy Markdown
Owner

Summary

  • add attemptsPerItem and revealAfterMax options to assignments
  • introduce Summary interface and track attempts in results
  • update components to use new summary metrics

Testing

  • npm test
  • npm run build

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

@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/ResultsModal.tsx Outdated
Comment on lines +25 to +27
return `Homework: ${assignment.title} (v${assignment.version})
Student: ${student.name || 'N/A'}
Result: ${score} correct (${summary.reveals} reveals)
Result: ${score} solved (${summary.reveals} reveals, ${summary.firstTry} first try, avg ${summary.avgAttempts.toFixed(2)} attempts)

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] Handle missing avgAttempts when rendering legacy progress

Existing homework progress in localStorage was saved with the old summary shape ({correct, total, reveals}) and does not include the new avgAttempts field. loadProgress returns that JSON verbatim, so when a learner completes an old assignment and the results modal tries to render, summary.avgAttempts is undefined and calling toFixed(2) throws. Users who upgrade with saved progress will hit a runtime error as soon as the modal or share text is constructed. Consider defaulting these new fields when loading or guarding the formatting.

Useful? React with 👍 / 👎.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary

  • Normalize legacy progress data by supplying defaults for newly added summary metrics such as solvedWithinMax and avgAttempts during loadProgress, ensuring backward compatibility utils/storage.tsL11-L29
  • Prevent runtime errors when sharing results by falling back to 0 before formatting avgAttempts with toFixed components/ResultsModal.tsxL25-L31
  • Add regression test confirming that loadProgress upgrades legacy summaries to the new shape utils/tests/storage.test.tsL69-L92

Testing

  • npm test
  • npm run build

View task →

@abocha
abocha merged commit 4011e4d into main Sep 15, 2025
2 checks passed
@abocha
abocha deleted the codex/update-assignmentoptions-and-summary-interface branch September 15, 2025 14:47
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