.
This commit is contained in:
+7
-11
@@ -306,7 +306,7 @@ class Exam(ExamBase):
|
||||
)
|
||||
|
||||
def get_exam_json(self):
|
||||
questions = exam.exam_questions.all()
|
||||
questions = self.exam_questions.all()
|
||||
|
||||
exam_questions = defaultdict(dict)
|
||||
|
||||
@@ -317,14 +317,10 @@ class Exam(ExamBase):
|
||||
|
||||
# Loop through longimage associations
|
||||
images = []
|
||||
feedback_images = []
|
||||
for i in q.images.all():
|
||||
if i.feedback_image == True:
|
||||
feedback_images.append(image_as_base64(i.image))
|
||||
# feedback_images.append(i.image.url)
|
||||
else:
|
||||
images.append(image_as_base64(i.image))
|
||||
#images.append(i.image.url)
|
||||
for series in q.series:
|
||||
for i in series.images.all():
|
||||
#images.append(image_as_base64(i.image))
|
||||
images.append(i.image.url)
|
||||
|
||||
|
||||
|
||||
@@ -343,7 +339,7 @@ class Exam(ExamBase):
|
||||
"eid": "long/{}".format(exam.id),
|
||||
"cached": False,
|
||||
"exam_type": "long",
|
||||
"exam_name": exam.name,
|
||||
"exam_name": self.name,
|
||||
"exam_mode": True,
|
||||
"exam_order": exam_order,
|
||||
"questions": exam_questions,
|
||||
@@ -351,7 +347,7 @@ class Exam(ExamBase):
|
||||
|
||||
|
||||
if exam.time_limit:
|
||||
exam_json["exam_time"] = exam.time_limit
|
||||
exam_json["exam_time"] = self.time_limit
|
||||
|
||||
return exam_json
|
||||
|
||||
|
||||
+3
-3
@@ -387,17 +387,17 @@ class Exam(ExamBase):
|
||||
|
||||
|
||||
exam_json = {
|
||||
"eid": "rapid/{}".format(exam.id),
|
||||
"eid": "rapid/{}".format(self.id),
|
||||
"cached": False,
|
||||
"exam_type": "rapid",
|
||||
"exam_name": exam.name,
|
||||
"exam_name": self.name,
|
||||
"exam_mode": True,
|
||||
"exam_order": exam_order,
|
||||
"questions": exam_questions,
|
||||
}
|
||||
|
||||
if exam.time_limit:
|
||||
exam_json["exam_time"] = exam.time_limit
|
||||
exam_json["exam_time"] = self.time_limit
|
||||
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user