[ARCHIVED] API to get highest score of Assignments for all students on a course
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We currently use the following API, which is meant to give the highest score (based on all completed attempts) for a specific acitivty - for ALL students on that course (a staff development one):
'https://hcuk.instructure.com/api/v1/courses/1906/assignments/' . $assignment_id . '/submissions?access_token=' . $key . '&include=user&grouped=true&per_page=100&page=' . $page;
(don't worry about page number, we calculate that to iterate through the paginated results, and $key is our access token which we know to work).
The code runs this on a loop of assignment_id values that we are interested in.
Unfortunately, one of our packages (3rd party) is faulty, and when you open up a new attempt it sets the 'current score' on canvas to be 0. Even if you have a previous attempt that has saved a score of 100%. We have reported this to the company that did it, but not had a fixed version.
It does scupper the results up from the above API call, if a student has clicked on it by mistake but not successfully completed it and closed it.
The web version clearly shows, in Gradebook History, the status of the previous attempts (including where people have got 100% before, but opened a new version without completing it so their current score is now 0).
But the Gradebook History APIs are badly thought out, in that they fail to offer an API which will just take a course ID and assingment ID and user ID - that is what I really want.
So, I tried using a variant of this call to give me ALL submissions by ALL students on a course, to a specific assignment - by removing the 'grouped=true' part. I was told by canvas support that adding this parameter would guarantee me the highest score, but where a package has stuffed things up, this clearly is not the case.
Anyhow, my test export from this method does NOT show me all the attempts that have been made.
Has anyone found a way of doing this?
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.