I use the endpoint below to get all submissions from a specific course
For each answer, I have a html_url, for example
that is converted to
I was able to see the user_id by the URL and all answers from that user on the HTML page.
Is there an API endpoint that I was able to see the answers from the student(including the answer that students write).
There is an documented switch that has the undocumented side effect of giving you the quiz responses.
Get the submissions (not quiz submissions) for the corresponding assignment and be sure to add the query parameter: include=submission_history.
Let's say that I have a quiz at /courses/896851/quizzes/3986251. If I GET /api/v1/courses/896851/quizzes/3986251, I see that the assignment_id is 13300109.
Then I GET /api/v1/courses/896851/assignments/13300109/submissions?include=submission_history.
It returns an array of users, and each user that has taken the quiz has a submission_history.submission_data array. That array contains an object for each question.
Here is an example (just the submission_data portion) from a quiz I gave.
"text":"<p>An ancient Egyptian casket.</p>",
The response to the essay question (question 2) was "An ancient Egyptian casket."
To make sense out of the first question, you need to get the information about the question from somewhere else.
I can do that with GET /api/v1/courses/896851/quizzes/3986251/questions
The first question had question_id=73065717 and was "What is the teacher's favorite color?". From the answers object, you can tell what response 5521 is. Do NOT look at the text property here, they didn't type 5521.
For the second question, id=73065719, the question_type was "essay_question" and the text was "Explain sarcasm." The text in this case is what the student typed.
See the appendix of question answer formats at the bottom of the Quiz Submission Questions API documentation for additional information.
Hi @fabiocunha ,
Did you tried to get all submissions for all assignments? And after that search for your quiz_id?
I had a similar issue in the past and @jamesjonespa kindly helped me with excellent explanations on that post: https://community.canvaslms.com/thread/44434-is-there-an-api-call-that-get-a-list-of-all-submissions...
Hope it helps!
Is your quiz a practice quiz or ungraded survey? They may not have assignments associated with them. One thing you could do (untested) is to go to your beta instance, change it to be a graded assignment, and then get the results out of it as I described earlier.
Quizzes that don't have an associated gradebook entry will not return an assignment_id. I would assume there is no way to get submission_history for them.
Hi James, I tried this but it didn't work. Can you verify that it's still working on your end? I am not seeing the submission_data portion in the response