cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
akumar25
Community Member

quiz submission update api - missing key ":quiz_submissions"

Jump to solution

Hello,

I've been trying to figure out how to update a students quiz grade through CanvasAPI. I keep getting this error: 

missing required key :quiz_submissions

I don't know what it means and I can't figure out what about my script to change to make this work. any ideas?

def updateGrade():
uri = url +'41' + '/quizzes/235/submissions/73'
record = {
"quiz_submissions[][fudge_points]" : -3.4
}

r = requests.put(uri, headers = headers, data=ques)
jsonData = r.json()
print(json.dumps(jsonData, indent=4))
print(r.status_code)
Tags (1)
1 Solution

Accepted Solutions
pklove
Community Champion

I haven't tried this, but according to the docs you need to specify the attempt that you are updating, so you probably also need to specify quiz_submissions[][attempt]

View solution in original post

2 Replies
pklove
Community Champion

I haven't tried this, but according to the docs you need to specify the attempt that you are updating, so you probably also need to specify quiz_submissions[][attempt]

View solution in original post

akumar25
Community Member

Hello Peter,

that fixed it. Thank you so much!