Find all assignments with no submissions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all! I'm looking for a bit of advice using the Canvas API to find a body of assignments across any of our active courses. Specifically I'm looking for assignments that:
- are posted to the SIS
- have an upcoming due date
- do not yet have any submissions
I'd also like to find what sections each assignment is assigned to. I'm fairly familiar with using the Canvas REST API, so getting started there is not a problem. Rather, the procedure to find all of these seems rather dense. Right now it looks a bit like this:
- Find all active courses (state = available)
- Iterate through courses and list all assignments (with post_to_sis = true and bucket = 'upcoming')
- Iterate through each upcoming assignment and list all submissions and their workflow state
Am I going about this the wrong way? Is there potentially a faster or more elegant way to find this information? So far I've only worked with the traditional REST API, but if there is a better way to do this with GraphQL I'm open to that as well.
Thanks all!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's a solution! But there might be a way to save yourself a call --
There is a boolean in the Assignments JSON object as shown below:
// If true, the assignment has been submitted to by at least one student
"has_submitted_submissions": true,
That should tell you if something is submitted by a student (I'm not sure if the test student counts, though.). I believe this is the field that Canvas reads to prevent an assignment with submissions to be unpublished by the teacher.
Hope this helps!