Skip to content

Conversation

@scottgrayson
Copy link
Contributor

@scottgrayson scottgrayson commented Jan 29, 2026

Details

Fixes three bugs:

  1. Course completion impossible when no test steps exist: maybeSetCompletedAtForUser() now skips the required_test_percentage check if no test steps are present, allowing completion. The CourseCompleted page also applies this logic.
  2. Unused property urlToFirstStepBelowPerfect: Removed the unused $urlToFirstStepBelowPerfect property and its assignment from CourseCompleted to eliminate dead code.
  3. Certificate download allowed after failing retake tests: retakeTest() now clears the course's completed_at timestamp on the user pivot table, ensuring re-evaluation of completion status and preventing certificate download if the user no longer qualifies.

Note

Medium Risk
Touches core course completion/certificate eligibility logic and modifies pivot completed_at state on retake, which could affect user progress if edge cases are missed; scope is small and localized.

Overview
Fixes course completion/certificate eligibility edge cases around test requirements and retakes.

Course::maybeSetCompletedAtForUser() and the CourseCompleted page now skip the required_test_percentage gate when a course has no test steps, preventing users from being blocked from completing a course/certificate due to a missing test set. TestStep::retakeTest() now clears the user’s course pivot completed_at so completion (and certificate availability) is re-evaluated after a retake, and dead code on CourseCompleted ($urlToFirstStepBelowPerfect) is removed.

Written by Cursor Bugbot for commit c8724da. This will update automatically on new commits. Configure here.

…ficate download after retake

- Skip test percentage check when no test steps exist (prevents impossible completion)
- Remove unused urlToFirstStepBelowPerfect property from CourseCompleted page
- Clear course completed_at when retaking tests to re-evaluate eligibility
@scottgrayson scottgrayson merged commit 2ae521c into 868h658e9-require-course-correctness-percentage Jan 29, 2026
2 of 7 checks passed
@scottgrayson scottgrayson deleted the cursor/course-completion-and-certificates-3c08 branch January 29, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants