Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing the canvas sync which stopped working. It appeared that using … #639

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
Contributor

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