Skip to content

Conversation

etrickel
Copy link
Contributor

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:

  • User Retrieval Update: Modified the grade synchronization script to first make a call to the Canvas API to fetch all users associated with the course. This is done using the /api/v1/courses/{course_id}/users endpoint, which returns all user data, including both sis_user_id and Canvas's internal id.
  • ID Mapping: Created a mapping from 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.
  • Grade Submission Adjustment: Updated the grade submission logic to use Canvas's internal user IDs instead of SIS IDs. This involved adjusting the payload of the API call to the /api/v1/courses/{canvas_course_id}/assignments/{assignment_id}/submissions/update_grades endpoint, ensuring that grades are correctly associated with user accounts in Canvas.

…sis_user_id in grade data is no longer working. Fixed this by adding a call to canvas to get all users and then create a map to canvas id.
@zardus
Copy link
Member

zardus commented Jan 30, 2025

@ConnorNelson is this mergeable?

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.

2 participants