Canvas Data for Grading
In this article, we will show you how Canvas stores its grading data. We will use the following example:
BUS101 is a course in Canvas (Canvas Course Id:1788). There are 3 students enrolled into this course. Their Canvas Student Id is listed next to their name for reference purpose.
BUS101 is made up for 3 assignment groups.
Assignment Group |
Weightage |
Assignment 1 | 25% |
Assignment 2 | 25% |
Assignment 3 | 50% |
If we take Student2:4048 as an example, the total score of 89.25% is calculated based on the following formula:
Assignment 1 Mark * Assignment 1 Weightage + Assignment 2 Mark * Assignment 2 Weightage + Assignment 3 Mark * Assignment 3 Weightage
85 * 25% + 90% * 25% + 91% * 50% = 89.25%
Behind the scene, this is the data we can retrieve via Canvas API.
/api/v1/courses/1788/assignment_groups [ { "id": 5255, "name": "Assignment 1", "group_weight": 25.0, }, { "id": 5256, "name": "Assignment 2", "group_weight": 25.0, }, { "id": 5257, "name": "Assignment 3", "group_weight": 50.0, } ]
If we query all the assignment groups for this course (1788), you can see the weightage at group_weight.
The actual mark of each individual student is listed per assignment group per student. To retrieve it, we use another API. For example, if I want to get all the assignments for Assignment 2 (Assignment Group Id: 5256), we can do this:
/api/v1/courses/1788/assignment_groups/5256/assignments [ { "id": 6819, "description": "Assignment 2 description", "points_possible": 100.0, "assignment_group_id": 5256, "course_id": 1788, "name": "Assignment 2", } ]
In this assignment, there is only 1 assignment related to 5256 assignment groups, we can then query all the submissions using the following API:
/api/v1/courses/1788/assignments/6819/submissions [ ... { "assignment_id": 6819, "id": 200474, "grading_period_id": null, "user_id": 4048, "body": null, "url": null, "grade": "90", "score": 90.0, }, ... ]
By looking at the example above, you can see that Student 2:4048 has scored 90% in their Assignment 2 and from the Assignment Group, we know that it carries 25% of weightage.