From 44f266433f99e0b02c55fe224f633fe2722ad2ea Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 18 Oct 2021 17:37:40 +0100 Subject: [PATCH] . --- anatomy/models.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/anatomy/models.py b/anatomy/models.py index ccc4ee9f..b6f51083 100644 --- a/anatomy/models.py +++ b/anatomy/models.py @@ -355,7 +355,7 @@ class Exam(ExamBase): related_name="anatomy_exam_author", ) - def get_exam_json(self): + def get_exam_json(self, based=True): questions = self.exam_questions.all() exam_questions = defaultdict(dict) @@ -365,10 +365,15 @@ class Exam(ExamBase): for q in questions: exam_order.append(q.id) + if based: + image = image_as_base64(q.image) + else: + image = q.iamge.url + exam_questions[q.id] = { "title": q.get_title(), "question": str(q.question_type), - "images": [image_as_base64(q.image)], + "images": [image], "annotations": [str(q.image_annotations)], "type": "anatomy", }