AnsweredAssumed Answered

Canvas API: Structure of answer object for numerical answer question

Question asked by Bart Hobijn on Jan 16, 2019
Latest reply on May 12, 2020 by Michael Boldin

I am using the Canvas API to develop a set of questions the answers to which automatically get updated to reflect the lastest economic data. Some of these questions are numerical_answer type questions. However when I post

 

answers = [ { 'text': '',  'comments': '',  'comments_html': '', 'weight': 100, 'numerical_answer_type': 'exact_answer', 'exact': 12.3, 'margin': 0.1} ]

 

then the question does get created with  'numerical_answer_type' as 'exact_answer', but the 'exact' and 'margin' entries are not updated on Canvas to the right answer. Instead, they are set to zero. Does someone know how to structure the post of the answer object in the Canvas API for a numerical_answer question such that these answers get properly posted to the server?

 

Bart Hobijn

Outcomes