[ARCHIVED] Canvas Quiz Submission API does not return all submissions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi I am new to Canvas API usage.
I am trying to write a script using PowerShell that needs to grab all submissions data of a particular quiz in a section (Submission Time, Kept Score, User ID etc). I am using the following API call:
$url = "https://$domain/api/v1/courses/<course #>/quizzes/<quiz #>/submissions?include[]=user"
using the following invoke-webrequest block:
$quizObject = Invoke-WebRequest -Headers $headers -Method Get -Uri $url |
convertfrom-json |
select -expand quiz_submissions |
select user_id, finished_at, kept_score | export-csv -path quizObjectOutput.csv -NoTypeInformation
I am able to get data back, use the JSON data etc and get my script to do everything I needed to do.
The issue is, I am only getting partial data back, exactly 10 submissions. I exported the grade book via GUI and can see I there are roughly 50 submissions for the quiz. Is there any API limitation that I am not aware of? Why I am not getting all 50 submissions?
any help is appreciated!! I have hit the brick wall with this!!
Update:
I found this - which seems to answer why I am getting only 10 results because responses are paginated.
what it does not tell me is How do I know how many pages I have beforehand?
How am I supposed to loop through the pages if I don't know how many pages are out there?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hmm I'm not familiar with Powershell. I found this, don't know if it is helpful?
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.