diff --git a/anatomy/models.py b/anatomy/models.py index 0fd699b1..b9082712 100644 --- a/anatomy/models.py +++ b/anatomy/models.py @@ -275,6 +275,9 @@ class Exam(models.Model): def __str__(self): return self.name + def get_absolute_url(self): + return reverse("anatomy:exam_overview", kwargs={"pk": self.pk}) + def get_exam_name(self): return self.name diff --git a/physics/models.py b/physics/models.py index d18b00ea..7c08e20e 100644 --- a/physics/models.py +++ b/physics/models.py @@ -94,6 +94,9 @@ class Question(models.Model): if self.e: self.e = self.e.strip() + def get_absolute_url(self): + return reverse("physics:question_detail", kwargs={"pk": self.pk}) + def get_answers(self): return (self.a_answer, self.b_answer, self.c_answer, self.d_answer, self.e_answer) @@ -127,12 +130,15 @@ class Exam(models.Model): def get_exam_name(self): return self.name - def get_json_url(self): - return reverse("anatomy:exam_json", args=(self.pk,)) + #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) + def get_absolute_url(self): + return reverse("physics:exam_overview", kwargs={"pk": self.pk}) + class CidUserAnswer(models.Model): """User answers by candidate""" diff --git a/physics/templates/physics/base.html b/physics/templates/physics/base.html index 301209d7..b3453fbd 100644 --- a/physics/templates/physics/base.html +++ b/physics/templates/physics/base.html @@ -8,6 +8,7 @@ + diff --git a/physics/templates/physics/exam_overview.html b/physics/templates/physics/exam_overview.html index 42bcca19..7cc22d11 100644 --- a/physics/templates/physics/exam_overview.html +++ b/physics/templates/physics/exam_overview.html @@ -14,7 +14,9 @@ Publish results: [When checked the exam results will be available on this site] + This exam will be available to take here. + {% autoescape off %}
    {% for question in questions.all %} @@ -37,10 +39,12 @@ {{ question.e }}: {{ question.e_answer }}
- Category: {{ question.category }}, View + Category: {{ question.category }}, View Edit + {% endfor %} + {% endautoescape %} - +