From 6b4a3f7479f6a4824acd3eaa096685ae6901ad87 Mon Sep 17 00:00:00 2001 From: Ross Date: Thu, 11 Mar 2021 12:51:53 +0000 Subject: [PATCH] . --- generic/views.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/generic/views.py b/generic/views.py index 73ab0a07..7e00a2a2 100644 --- a/generic/views.py +++ b/generic/views.py @@ -323,15 +323,21 @@ class ExamViews(View, LoginRequiredMixin): creation_time = exam.json_creation_time.isoformat() else: creation_time = "None" - active_exams["exams"].append( - { + + json = { "name": exam.get_exam_name(), "url": request.build_absolute_uri(exam.get_json_url()), "type": self.question_type, "eid": "{}/{}".format(self.question_type, exam.pk), "json_creation_time": creation_time } - ) + + if self.question_type == "long": + h = {} + for question in exam.questions.all(): + h[question.pk] = question.json_creation_time + json["multi_question_json"] = h + active_exams["exams"].append( json ) if json == False: return active_exams["exams"]