.
This commit is contained in:
+11
-1
@@ -685,7 +685,17 @@ class CidUserAnswer(models.Model):
|
||||
def get_absolute_url(self):
|
||||
return reverse("rapids:user_answer_view", kwargs={"pk": self.pk})
|
||||
|
||||
def get_answer_score(self):
|
||||
def get_answer_score(self, cached=True):
|
||||
if cached and self.score:
|
||||
if self.score == Answer.MarkOptions.CORRECT:
|
||||
mark = 2
|
||||
elif self.score == Answer.MarkOptions.HALF_MARK:
|
||||
mark = 1
|
||||
elif self.score == Answer.MarkOptions.INCORRECT:
|
||||
mark = 0
|
||||
|
||||
return mark
|
||||
|
||||
q = self.question
|
||||
|
||||
# First step we check that the normal/abnormal states match
|
||||
|
||||
Reference in New Issue
Block a user