fixing the canvas sync which stopped working. It appeared that using … #639
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.
This commit addresses a critical issue where the synchronization process between pwn.college and Canvas broke due to changes in how Canvas handles SIS user IDs in the grade data submission.
Issue:
Previously, our system submitted grades directly using
sis_user_id
fields as identifiers in the grade data. Recent updates to the Canvas API have caused these submissions to fail, possibly due to changes in how Canvas handles external identifiers.Resolution:
To resolve this issue, the following changes were implemented:
/api/v1/courses/{course_id}/users
endpoint, which returns all user data, including bothsis_user_id
and Canvas's internalid
.sis_user_id
to Canvas's internal user ID (id
). This map is now used to translate the SIS IDs in our system to the corresponding Canvas IDs when submitting grade data./api/v1/courses/{canvas_course_id}/assignments/{assignment_id}/submissions/update_grades
endpoint, ensuring that grades are correctly associated with user accounts in Canvas.