This commit is contained in:
Ross
2021-12-18 17:45:48 +00:00
parent 8b8ab773ea
commit 2a3b8b06df
2 changed files with 18 additions and 10 deletions
+6
View File
@@ -468,6 +468,12 @@ class CidUserAnswer(models.Model):
# s = s.translate(str.maketrans('', '', string.punctuation))
# return s
def get_blank_answer(self):
return 0
def get_blank_answer_string(self):
return ""
def get_answer_score(self, cached=True):
if cached and self.score:
if self.score == Answer.MarkOptions.CORRECT:
+4 -2
View File
@@ -896,6 +896,8 @@ class ExamViews(View, LoginRequiredMixin):
user_scores_list = list(user_scores.values())
max_score = len(questions) * 2
if len(user_scores_list) < 1:
mean = 0
median = 0
@@ -920,8 +922,6 @@ class ExamViews(View, LoginRequiredMixin):
)
fig_html = fig.to_html()
max_score = len(questions) * 2
exam.stats_mean = mean
exam.stats_median = median
exam.stats_mode = mode
@@ -935,6 +935,8 @@ class ExamViews(View, LoginRequiredMixin):
exam.stats_graph = fig_html
exam.save()
return render(
request,
f"{self.app_name}/exam_scores.html",