Found this content helpful? Log in or sign up to leave a like!

Answer_ID Is Empty For Calculated Question Answered Wrong

JimEgan
Community Explorer

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.

Labels (1)