From 489958a9a7f4d55823502bed8f83aae371beeac4 Mon Sep 17 00:00:00 2001 From: Ross Date: Fri, 14 May 2021 22:08:42 +0100 Subject: [PATCH] . --- rad/views.py | 7 ++++--- rapids/models.py | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/rad/views.py b/rad/views.py index a9a6e83a..45c42490 100644 --- a/rad/views.py +++ b/rad/views.py @@ -197,9 +197,10 @@ class AddQuestionNote(CreateView): @csrf_exempt def answer_suggestion_submit(request): if request.is_ajax and request.method == "POST": - question_type, qid = request.POST.get("qid").split("/") - answer_string = request.POST.get("answer") - status = request.POST.get("status") + post_data = json.loads(request.body) + question_type, qid = post_data["qid"].split("/") + answer_string = post_data["answer"] + status = post_data["status"] if str(status) not in " 012": return JsonResponse({"success": False, "error": "Invalid status"}) diff --git a/rapids/models.py b/rapids/models.py index 3a8ef844..3cafa066 100644 --- a/rapids/models.py +++ b/rapids/models.py @@ -419,6 +419,7 @@ class Exam(ExamBase): exam_questions[q.id] = { "images": images, + "normal": q.normal, #"feedback_image": [], #"annotations": [str(q.image_annotations)], "type": "rapid",