Course completion and certificates #86
Merged
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.
Details
Fixes three bugs:
maybeSetCompletedAtForUser()now skips therequired_test_percentagecheck if no test steps are present, allowing completion. TheCourseCompletedpage also applies this logic.urlToFirstStepBelowPerfect: Removed the unused$urlToFirstStepBelowPerfectproperty and its assignment fromCourseCompletedto eliminate dead code.retakeTest()now clears the course'scompleted_attimestamp 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_atstate 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 theCourseCompletedpage now skip therequired_test_percentagegate 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 pivotcompleted_atso completion (and certificate availability) is re-evaluated after a retake, and dead code onCourseCompleted($urlToFirstStepBelowPerfect) is removed.Written by Cursor Bugbot for commit c8724da. This will update automatically on new commits. Configure here.