Found this content helpful? Log in or sign up to leave a like!

Submission Workflow State 'Deleted'

DOGutierrez
Community Explorer

Hello, 

I have been using the API to check my students' weekly progress in all of their courses. 

The central function that I use to do so identifies all of the assignments that were due for the student in the previous week, and then checks to see whether or not they have submitted that assignment, what score they received, etc. 

Lately, however, I started to notice that the results of that function are no longer accurate. Specifically, the API call to get the students' assignment submissions is not returning submissions for all students. I have seen this in two ways. 

1) When retrieving all submissions for a given assignment (via this API Call: List assignment submissions). The results do not include several students who have been assigned and should otherwise have a submission. 

For reference, this is what that API call looks like in the python that I use (this is all within a for loop iterating through a list of my students): 

course = canvas.get_course($course_id)
asg = course.get_assignment($asg_id)
submissions = asg.get_submissions()

for sub in submissions:

    state = sub.workflow_state
    user_id = sub.user_id

    try:
        user = get_user($user_id)
    except Exception:
        continue

    name = user.name

    print([name, state])

Whenever I check the gradebook via the UI, I can see student submissions that were not returned by this API call, including some which were in fact submitted, as well as others which are missing, all of which have been graded. 

 

2) I have also tried retrieving these submissions via the Get a single submission method

submission = asg.get_submission($user_id)

This at least does locate the submission for every student, but it still doesn't seem to be accurate. For those students whose submissions weren't appearing in the previous API call, their submissions have a workflow_state of 'deleted' and no other information. 

I'm not sure why they have this workflow-state. Again, via the gradebook and SpeedGrader I can see that these submissions quite clearly are there. I haven't seen any common traits that might be causing this workflow_state (they are occurring on assignments with various different submission types, for submissions that are both submitted and missing, graded and waiting to be graded, and for different students across different assignments).  

The documentation doesn't even list 'deleted' as one of the possible values of workflow_state. So, I'm very confused, and not sure how I can resolve this so as to continue gathering information on my students' academic progress. 

If you have any ideas, I would greatly appreciate your help.

Labels (2)
0 Likes