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 Canvas Data 2 data, I'm looking at student answers for Calculated questions. When a question is correctly answered, the Answer_ID is populated. When the question is incorrectly answered the Answer_ID is empty/blank, in fact the name/value pair isn't even in the JSON. How am I supposed to match the student's (incorrect) answer (from quiz_submissions) to the correct value (from quiz_questions)?
Here's an example. The second question is the problem. I know which question the answer belongs to, but the absence of the answer_id tag prevents me from showing the correct value alongside the incorrect value of "16". The first question was answered correctly and has the answer_id. But since the question was correctly answered by the student there isn't much need to display the correct answer from quiz_questions.
{
"correct": true,
"points": 2,
"question_id": 6836328,
"answer_id": "8894",
"text": "5"
},
{
"correct": false,
"points": 0,
"question_id": 6836329,
"text": "16"
}
I'm seeing this problem in both current term and older terms.
As I go through the other question types I'll add to this thread those that have the same problem.
The "Fill in multiple blanks" question type also fails to fill in the answer ID when the student provides an incorrect value for the blank. Correctly entered blanks have the answer id value. Note that for this question type the name/value pair is there for an incorrect answer, the value is simply null.
In the example below, the student incorrectly filled in both blanks. The correct answers were "three" or "3" for A and "cell" for B.
{
"correct": false,
"points": 0,
"question_id": 8379995,
"text": "",
"answer_for_A": "primitive ",
"answer_id_for_A": null,
"answer_for_B": "equation",
"answer_id_for_B": null,
"more_comments": ""
}
In the case of how this answer was constructed by the instructor, it may make sense that there is no answer id provided in the above JSON. There are multiple correct answers for A (three and 3). So if the student answered blank A incorrectly, which correct value should the submission point to? In this case, it looks like Canvas threw up its hands and said, "None of them!" To work around this, I'm planning to do some ETL magic and find the first correct answer as defined by the instructor.
However, blank B has only one correct answer so there's no excuse for not providing the answer id that points to what the correct answer should be.
I'm a bit disappointed that Instructure hasn't jumped in here to either clarify why they programmed the result this way or to confirm that it's a problem. I'm also surprised that no other developers have found this issue. Maybe I'm super deep in the weeds with this and no other schools have gone into the data like my school has.
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