Find all assignments with no submissions

Jump to solution
matt2
Community Explorer

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:

  1. are posted to the SIS
  2. have an upcoming due date
  3. 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:

  1. Find all active courses (state = available)
  2. Iterate through courses and list all assignments (with post_to_sis = true and bucket = 'upcoming')
  3. 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!

0 Likes
1 Solution
melodyc_lam
Community Coach
Community Coach

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!

View solution in original post