add function to get exam index from list
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user