This commit is contained in:
Ross
2021-03-09 15:28:54 +00:00
parent 7846eff6a3
commit d5637a1402
7 changed files with 84 additions and 3 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ class ExamBase(models.Model):
help_text="If the json cache needs updating", default=False
)
json_creation_time = models.DateTimeField(blank=True)
json_creation_time = models.DateTimeField(blank=True, default=None, null=True)
#time_limit = models.IntegerField(
# help_text="Exam time limit (in seconds). Default is 2100 secondse (35 minutes)",
+5 -1
View File
@@ -319,13 +319,17 @@ class ExamViews(View, LoginRequiredMixin):
for exam in exams:
if exam.active:
if exam.json_creation_time:
creation_time = exam.json_creation_time.isoformat()
else:
creation_time = "None"
active_exams["exams"].append(
{
"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": exam.json_creation_time.isoformat()
"json_creation_time": creation_time
}
)