From b014722d2e7514e00f32349746861d9ce845542b Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 13 May 2024 10:08:01 +0100 Subject: [PATCH] show human readable time on exam overview page --- generic/models.py | 2 +- generic/templates/generic/exam_overview_headers.html | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/generic/models.py b/generic/models.py index 514e1423..89545fd3 100644 --- a/generic/models.py +++ b/generic/models.py @@ -903,7 +903,7 @@ class ExamBase(ExamOrCollectionGenericBase): h, m, s = str(datetime.timedelta(seconds=self.time_limit)).split(":") time_limit = "" - if s != "0": + if s != "0" and s != "00": time_limit = f" {s} second(s)" if m != "0": time_limit = f"{m} minute(s) {time_limit}" diff --git a/generic/templates/generic/exam_overview_headers.html b/generic/templates/generic/exam_overview_headers.html index 5af693c7..c611ede0 100644 --- a/generic/templates/generic/exam_overview_headers.html +++ b/generic/templates/generic/exam_overview_headers.html @@ -27,7 +27,10 @@ {% endif %} -This exam has {{question_number}} questions. Time limit: {{exam.time_limit}} seconds. +This exam has {{question_number}} questions. +Time limit: {{exam.time_limit}} seconds [{{exam.get_time_limit}}] + +. Exam mode: {{ exam.exam_mode }}
{% if exam.exam_mode %}