Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POST Quiz Question answer_comments does not function #2045

Closed
tomsant opened this issue Apr 14, 2022 · 1 comment
Closed

POST Quiz Question answer_comments does not function #2045

tomsant opened this issue Apr 14, 2022 · 1 comment

Comments

@tomsant
Copy link

tomsant commented Apr 14, 2022

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:

  1. POST quiz question including option parameter for answer_comments
  2. View quiz in canvas
  3. 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.

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 }

@tomsant
Copy link
Author

tomsant commented Apr 16, 2022

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].

@tomsant tomsant closed this as completed Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant