diff --git a/anatomy/models.py b/anatomy/models.py index e7d805a8..fd1b07d4 100644 --- a/anatomy/models.py +++ b/anatomy/models.py @@ -275,6 +275,9 @@ class Exam(models.Model): def get_json_url(self): return reverse("anatomy:exam_json", args=(self.pk,)) + def get_question_index(self, question): + return list(self.exam_questions.all()).index(question) + class UserAnswer(models.Model): question = models.ForeignKey( diff --git a/anatomy/templates/anatomy/exam_scores.html b/anatomy/templates/anatomy/exam_scores.html index a9975140..26cd2f6e 100644 --- a/anatomy/templates/anatomy/exam_scores.html +++ b/anatomy/templates/anatomy/exam_scores.html @@ -7,7 +7,7 @@ {% if unmarked %} The following questions need marking {% for question in unmarked %} - {{question.pk}} + {{ exam|get_question_index:question }} {% endfor %} {% endif %}