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