Which API to read a student's Individual assignment grade?

Jump to solution
devpool
Community Novice

I tried using /users/:userId/courses/:courseId/assignments

Assignments - Canvas LMS REST API Documentation 

But it seems does not return grades for student's grade for individual assignment.

 

And then tried Canvas LMS REST API Documentation 

GET /api/v1/courses/:course_id/analytics/users/:student_id/assignments

It seems we need analytics module, not sure how to enable it in open source version.

Also tried,

/api/graphql?per_page=100

with,

{
"query": "query MyQuery { assignment(id: 2) {
submissionsConnection(first: 100) {
nodes {
_id

user {
_id
name
email
}
}
pageInfo {
endCursor
}
}
}
}",
"variables": {}
}

My Question is,

Which Api end point should we be using to retrieve grades for individual assignment please?

What are the options available for me in API?

Appreciate any help/thoughts and suggestions.

Thanks!

1 Solution
James
Community Champion

 @devpool  

Use the Submissions API to get a student's grade on an assignment. There are different flavors available depending on whether you want all students for a single assignment, a single assignment for a single student, or multiple assignments or multiple students (you get to specify).

Note that the last I checked, concluded and inactive students are not included when you try to get grades for all students, you will need to include their user IDs specifically.

View solution in original post