.
This commit is contained in:
@@ -468,6 +468,12 @@ class CidUserAnswer(models.Model):
|
|||||||
# s = s.translate(str.maketrans('', '', string.punctuation))
|
# s = s.translate(str.maketrans('', '', string.punctuation))
|
||||||
# return s
|
# return s
|
||||||
|
|
||||||
|
def get_blank_answer(self):
|
||||||
|
return 0
|
||||||
|
|
||||||
|
def get_blank_answer_string(self):
|
||||||
|
return ""
|
||||||
|
|
||||||
def get_answer_score(self, cached=True):
|
def get_answer_score(self, cached=True):
|
||||||
if cached and self.score:
|
if cached and self.score:
|
||||||
if self.score == Answer.MarkOptions.CORRECT:
|
if self.score == Answer.MarkOptions.CORRECT:
|
||||||
|
|||||||
+12
-10
@@ -896,6 +896,8 @@ class ExamViews(View, LoginRequiredMixin):
|
|||||||
|
|
||||||
user_scores_list = list(user_scores.values())
|
user_scores_list = list(user_scores.values())
|
||||||
|
|
||||||
|
max_score = len(questions) * 2
|
||||||
|
|
||||||
if len(user_scores_list) < 1:
|
if len(user_scores_list) < 1:
|
||||||
mean = 0
|
mean = 0
|
||||||
median = 0
|
median = 0
|
||||||
@@ -920,20 +922,20 @@ class ExamViews(View, LoginRequiredMixin):
|
|||||||
)
|
)
|
||||||
fig_html = fig.to_html()
|
fig_html = fig.to_html()
|
||||||
|
|
||||||
max_score = len(questions) * 2
|
exam.stats_mean = mean
|
||||||
|
exam.stats_median = median
|
||||||
|
exam.stats_mode = mode
|
||||||
|
|
||||||
exam.stats_mean = mean
|
exam.stats_candidates = len(user_scores_list)
|
||||||
exam.stats_median = median
|
exam.stats_max_possible = max_score
|
||||||
exam.stats_mode = mode
|
|
||||||
|
|
||||||
exam.stats_candidates = len(user_scores_list)
|
exam.stats_min = min(user_scores_list)
|
||||||
exam.stats_max_possible = max_score
|
exam.stats_max = max(user_scores_list)
|
||||||
|
|
||||||
|
exam.stats_graph = fig_html
|
||||||
|
exam.save()
|
||||||
|
|
||||||
exam.stats_min = min(user_scores_list)
|
|
||||||
exam.stats_max = max(user_scores_list)
|
|
||||||
|
|
||||||
exam.stats_graph = fig_html
|
|
||||||
exam.save()
|
|
||||||
|
|
||||||
return render(
|
return render(
|
||||||
request,
|
request,
|
||||||
|
|||||||
Reference in New Issue
Block a user