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!
Using the LMS REST API, is it possible to get a list of past quiz submissions with either the answers the user submitted for that attempt or whether the answer the user submitted was correct or not?
My use case is I want to the students to have unlimited attempts to get all the questions correct on a quiz. I want to show them which questions they got incorrect on their previous attempt.
I've been playing with the `Quiz Submission Questions` and `Quiz Submission` REST api's but it does not seem to return answers in JSON format, just a link to an HTML page with the answers.
Solved! Go to Solution.
Yes, you can get the specific information you are looking for via the API. It's a bit convoluted to do so since a bit of it is undocumented.
GET /api/v1/courses/:course_id/quizzes/:id
Start by getting the general information about the quiz. One of the attributes returned from this call will be an assignment_id (NOT the :quiz_id) corresponding to this quiz. Note that the REST API description of the Quiz object does not tell you that each quiz has a corresponding :assignment_id, but Canvas does send back this information in the response.
GET /api/v1/courses/:course_id/assignments/:assignment_id/submissions?include[]=submission_history
Next, get the submissions to the assignment (again, the assignment, NOT the quiz) and ask Canvas to include the submission history. This part actually is documented, but it's tucked away in the Submissions API instead of the Assignments API where I expected to find it.
This response will give you a submission_history array containing a submission_data array with the information about all the individual questions and whether they answered correctly or not.
Did you ever figure out this issue? I am trying to do something similar and I'm running into the same issue of the answer not being available. However, in the GUI you can view a student's previous attempt answers so it must be stored somewhere.
Yes, you can get the specific information you are looking for via the API. It's a bit convoluted to do so since a bit of it is undocumented.
GET /api/v1/courses/:course_id/quizzes/:id
Start by getting the general information about the quiz. One of the attributes returned from this call will be an assignment_id (NOT the :quiz_id) corresponding to this quiz. Note that the REST API description of the Quiz object does not tell you that each quiz has a corresponding :assignment_id, but Canvas does send back this information in the response.
GET /api/v1/courses/:course_id/assignments/:assignment_id/submissions?include[]=submission_history
Next, get the submissions to the assignment (again, the assignment, NOT the quiz) and ask Canvas to include the submission history. This part actually is documented, but it's tucked away in the Submissions API instead of the Assignments API where I expected to find it.
This response will give you a submission_history array containing a submission_data array with the information about all the individual questions and whether they answered correctly or not.
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