The Instructure Community will enter a read-only state on November 22, 2025 as we prepare to migrate to our new Community platform in early December. Read our blog post for more info about this change.
Found this content helpful? Log in or sign up to leave a like!
Sorry for what may be just a typical newb question.
I'm trying to write a python script to upload quiz scores.
It yields a 422 error.
I can do a get on the same URL, so the quiz submission being modified actually exists.
An appropriately sanitized curl version of the request is the following:
curl https://mysite.com/api/v1/courses/#######/quizzes/######/submissions/######## \
-d '{"quiz_submissions" : [{"attempt": 2, "fudge_points": 0, "questions": {"1": {"score": 7.0, "comment": "Category,Pts,Deductions;Report Clarity,1.0,1.0;Key 1,1.0,;Key 1 method,2.0,2.0;Key 2,1.0,;Key 2 method,2.0,;,,;Score,,7.0"}}}]}' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <MyTokenValueHere>'
The text of the response includes this message (which seems to be less than accurate or relevant):
There was a problem with your last request. You may have tried to perform an action after a long period of inactivity. If that's the case, try going back, reloading the page you were working on, and resubmitting. If not, please let us know what you were doing when the error happened.
If you see an obvious problem, I will sing the praises of your name.
Solved! Go to Solution.
And, yes, I am the teacher of the class, using one of my access tokens.
I was doing a POST rather than PUT. PUT worked fine.
BTW, I found a doc that said the score must be an integer. I changed it to 7 from 7.0 and it still yields a 422 error.
And now I found that the question id is actually a 6-digit ids and not an ordinal. I think this is the key. I must test it.
And it's still broken, even with a valid question id
And, yes, I am the teacher of the class, using one of my access tokens.
I was doing a POST rather than PUT. PUT worked fine.
Community helpTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign inTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign in