This commit is contained in:
Ross
2022-09-04 11:22:31 +01:00
parent 2500a17c16
commit e4c6d9196c
3 changed files with 17 additions and 3 deletions
+13
View File
@@ -124,6 +124,19 @@ class Question(models.Model):
self.e_answer,
)
def get_answer_by_choice(self, choice):
if choice == "a":
return self.a_answer
if choice == "b":
return self.b_answer
if choice == "c":
return self.c_answer
if choice == "d":
return self.d_answer
if choice == "e":
return self.e_answer
def get_correct_answer(self):
if self.best_answer == "a":
return self.a_answer