This commit is contained in:
Ross
2020-12-28 16:05:54 +00:00
parent d3e7a5c5b3
commit 238edf6358
2 changed files with 4 additions and 2 deletions
@@ -8,7 +8,7 @@
{% if previous > -1 %}
<a href="{% url 'anatomy:exam_question_detail' exam.id previous %}">Previous question</a>
{% endif %}
This question is part of exam: {{exam.name}}
This question is part of exam: {{exam.name}} [{{pos}}/{{exam_length}}]
{% if next %}
<a href="{% url 'anatomy:exam_question_detail' exam.id next %}">Next question</a>
{% endif %}
+3 -1
View File
@@ -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