From 238edf63584ef916840181a7e3c49a54d28c1580 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 28 Dec 2020 16:05:54 +0000 Subject: [PATCH] . --- anatomy/templates/anatomy/question_detail.html | 2 +- anatomy/views.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/anatomy/templates/anatomy/question_detail.html b/anatomy/templates/anatomy/question_detail.html index f8d95aea..1c9aa226 100644 --- a/anatomy/templates/anatomy/question_detail.html +++ b/anatomy/templates/anatomy/question_detail.html @@ -8,7 +8,7 @@ {% if previous > -1 %} Previous question {% endif %} - This question is part of exam: {{exam.name}} + This question is part of exam: {{exam.name}} [{{pos}}/{{exam_length}}] {% if next %} Next question {% endif %} diff --git a/anatomy/views.py b/anatomy/views.py index 52118477..19561b38 100644 --- a/anatomy/views.py +++ b/anatomy/views.py @@ -116,6 +116,8 @@ def exam_question_detail(request, pk, sk): exam_length = len(exam.exam_questions.all()) + pos = exam.get_question_index(question) + 1 + previous = -1 if sk > 0: previous = sk-1 @@ -123,7 +125,7 @@ def exam_question_detail(request, pk, sk): if sk == exam_length-1: next = False - return render(request, "anatomy/question_detail.html", {"question": question, "exam": exam, "next" : next, "previous" : previous, "exam_length" : exam_length}) + return render(request, "anatomy/question_detail.html", {"question": question, "exam": exam, "next" : next, "previous" : previous, "exam_length" : exam_length, "pos": pos}) @login_required