You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unable to POST quiz question with answer comments.
I have successfully built a script to create a quiz and quiz questions using python and the canvas API. I'm able to successfully create quiz questions and weights,
Steps to reproduce:
POST quiz question including option parameter for answer_comments
View quiz in canvas
See everything else but the answer_comments
Expected behavior:
Answer comments should be attached to each quiz question answer
Actual behavior:
They do not appear
Additional notes:
Here is the json I'm sending through. Again, note answer_text and answer_weight are correctly handled by the API, but answer_comments is not.
Solved! After updating the answer comment in the canvas ui and inspecting network traffic, I discovered the API documentation is incorrect here. The field is question[answers][#][answer_comment_html].
Summary:
Unable to POST quiz question with answer comments.
I have successfully built a script to create a quiz and quiz questions using python and the canvas API. I'm able to successfully create quiz questions and weights,
Steps to reproduce:
Expected behavior:
Answer comments should be attached to each quiz question answer
Actual behavior:
They do not appear
Additional notes:
Here is the json I'm sending through. Again, note answer_text and answer_weight are correctly handled by the API, but answer_comments is not.
question = { 'question[question_text]' : question_prompt, 'question[question_type]' : question_type, 'question[points_possible]' : 2, 'question[answers][0][answer_text]' : correct_answer, 'question[answers][0][answer_weight]' : 100, 'question[answers][0][answer_comments]' : '', 'question[answers][1][answer_text]' : wrong_answer_1, 'question[answers][1][answer_weight]' : 0, 'question[answers][1][answer_comments]' : wrong_answer_1_feedback, 'question[answers][2][answer_text]' : wrong_answer_2, 'question[answers][2][answer_weight]' : 0, 'question[answers][2][answer_comments]' : wrong_answer_2_feedback, 'question[answers][3][answer_text]' : wrong_answer_3, 'question[answers][3][answer_weight]' : 0, 'question[answers][3][answer_comments]' : wrong_answer_3_feedback }
The text was updated successfully, but these errors were encountered: