.
This commit is contained in:
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user