.
This commit is contained in:
+7
-2
@@ -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",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user