@MichaelFerero
The structure of the Answers object is a bit ambiguous. It is an array of answers, but it needs the index in there and just sending the JSON object doesn't do that for you.
One way to get the keys is to create an object and use the index as the property name.
{
"question": {
"question_name": "Question 3",
"question_text": "Two of the basic instructions implemented by a programming language include:",
"question_type": "multiple_choice_question",
"points_possible": 2,
"answers": {
"0": {
"answer_text": "input and resource allocation",
"answer_weight": 0
},
"1": {
"answer_text": "math and string processing",
"answer_weight": 0
},
"2": {
"answer_text": "output and monitoring program execution",
"answer_weight": 0
},
"3": {
"answer_text": "conditional execution and repetition",
"answer_weight": 100
}
}
}
}
I used answer_text instead of answer_html because there was no html in your text. If you're sending answer_html, you should wrap your text in HTML elements. By default, Canvas uses <p>...</p>
To figure out information like this, I use the developer tools in Chrome and look at the network traffic that is sent when I perform the action within Canvas. Then I know what the format should look like. What I saw was stuff like this:
questions[answers][0][answer_text]
questions[answers][0][answer_weight]
There was a bunch more, but that let me know what it should look like and the rest of the junk was junk -- it was for other types of questions.
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.