def _make_canvas_upload_raw(cls, registry: Registry, data, args): result = QuizQuestion._make_canvas_upload_common(registry, data, args) for index, answer in enumerate(data['answers']): base = 'question[answers][{index}]'.format(index=index) result[base + "[answer_text]"] = answer['text'] result[base + "[answer_comment_html]"] = answer['comments_html'] result[base + "[answer_weight]"] = 100 return result
def _make_canvas_upload_raw(cls, registry: Registry, data, args): result = QuizQuestion._make_canvas_upload_common(registry, data, args) result['question[matching_answer_incorrect_matches]'] = data[ 'matching_answer_incorrect_matches'] for index, answer in enumerate(data['answers']): base = 'question[answers][{index}]'.format(index=index) result[base + "[answer_match_left]"] = answer['left'] result[base + "[answer_match_right]"] = answer['right'] result[base + "[answer_comment_html]"] = answer['comments_html'] result[base + "[answer_weight]"] = 100 # TODO: Unnecessary? result[base + "[answer_precision]"] = 10 # TODO: Unnecessary? return result
def _make_canvas_upload_raw(cls, registry: Registry, data, args): result = QuizQuestion._make_canvas_upload_common(registry, data, args) for index, answer in enumerate(data['answers']): base = 'question[answers][{index}]'.format(index=index) result[base + "[answer_comment_html]"] = answer['comments_html'] result[base + "[numerical_answer_type]"] = answer['numerical_answer_type'] if answer['numerical_answer_type'] == 'exact_answer': result[base + "[answer_exact]"] = answer['exact'] result[base + "[answer_error_margin]"] = answer.get( 'margin', 0) elif answer['numerical_answer_type'] == 'range_answer': result[base + "[answer_range_start]"] = answer['start'] result[base + "[answer_range_end]"] = answer['end'] elif answer['numerical_answer_type'] == 'precision_answer': result[base + "[answer_precision]"] = answer['precision'] result[base + "[answer_approximate]"] = answer['approximate'] return result
def _make_canvas_upload_raw(cls, registry: Registry, data, args): return QuizQuestion._make_canvas_upload_common(registry, data, args)