show human readable time on exam overview page

This commit is contained in:
Ross
2024-05-13 10:08:01 +01:00
parent 89e9ded09a
commit b014722d2e
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -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}"
@@ -27,7 +27,10 @@
{% endif %}
This exam has {{question_number}} questions. <span title="Time per question: {% widthratio exam.time_limit question_number 1 %} seconds">Time limit: {{exam.time_limit}} seconds</span>.
This exam has {{question_number}} questions.
<span title="Time per question: {% widthratio exam.time_limit question_number 1 %} seconds">Time limit: {{exam.time_limit}} seconds [{{exam.get_time_limit}}]
<i class="bi bi-info-circle"></i>
</span>.
Exam mode: {{ exam.exam_mode }}<br />
{% if exam.exam_mode %}