I believe that there is a fundamental error in an assumption made in Canvas that all questions of the types:
missing_word, multiple_answers, and multiple_choice must have a correct answer and if they do not, the code turns the first answer into a "correct" answer - even though it is incorrect by using: "@answers.set_correct_if_none"
See app/models/quizzes/quiz_question/answer_parsers/
- missing_word.rb
- multiple_answers.rb
- multiple_choice.rb
This is quite a disturbing finding since it means that the system overrides the setting of the answer_weight in the answers.
Response Body
[ { "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">id</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">17983</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">quiz_id</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">2476</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">quiz_group_id</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">1393</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">assessment_question_id</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">16971</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">position</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">1</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">question_name</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">"Q5"</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">question_type</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">"multiple_answers_question"</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">question_text</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">"<p>The question is xxxxx?</p>"</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">points_possible</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">1</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">correct_comments</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">""</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">incorrect_comments</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">""</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">neutral_comments</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">""</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">correct_comments_html</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">""</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">incorrect_comments_html</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">""</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">neutral_comments_html</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">""</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">answers</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">[ { "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">id</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">8617</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">text</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">"first incorrect answer"</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">comments</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">""</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">comments_html</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">""</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">weight</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">0</SPAN> }</SPAN>, { "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">id</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">8697</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">text</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">"second incorrect answer"</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">comments</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">""</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">comments_html</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">""</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">weight</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">0</SPAN> }</SPAN>, { "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">id</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">3447</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">text</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">"first correct answer"</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">comments</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">""</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">comments_html</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">""</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">weight</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">100</SPAN> }</SPAN> ]</SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">variables</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">null</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">formulas</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">null</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">answer_tolerance</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">null</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">formula_decimal_places</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">null</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">matches</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">null</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">matching_answer_incorrect_matches</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">null</SPAN> }</SPAN>, { "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">id</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">17984</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">quiz_id</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">2476</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">quiz_group_id</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">1393</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">assessment_question_id</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">16972</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">position</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">2</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">question_name</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">"Q6"</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">question_type</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">"multiple_answers_question"</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">question_text</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">"<p>The question is xxxxx?</p>"</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">points_possible</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">1</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">correct_comments</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">""</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">incorrect_comments</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">""</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">neutral_comments</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">""</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">correct_comments_html</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">""</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">incorrect_comments_html</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">""</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">neutral_comments_html</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">""</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">answers</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">[ { "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">id</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">9963</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">text</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">"first incorrect answer"</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">comments</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">""</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">comments_html</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">""</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">weight</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">100</SPAN> }</SPAN>, { "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">id</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">9301</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">text</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">"second incorrect answer"</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">comments</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">""</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">comments_html</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #880000; border: 0px; font-weight: inherit; font-size: inherit;">""</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">weight</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">0</SPAN> }</SPAN> ]</SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">variables</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">null</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">formulas</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">null</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">answer_tolerance</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">null</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">formula_decimal_places</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">null</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">matches</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">null</SPAN></SPAN>, "<SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;">matching_answer_incorrect_matches</SPAN>": <SPAN class="" style="border: 0px; font-weight: inherit; font-size: inherit;"><SPAN class="" style="color: #008800; border: 0px; font-weight: inherit; font-size: inherit;">null</SPAN> }</SPAN>]The code that puts these two questions into the quiz is available via https://kth.instructure.com/courses/11/pages/canvas-turns-first-answer-into-the-correct-answer-even-if-it-is-incorrect-when-there-are-not-correct-answers
The page also includes a zip file of the exported quiz.