diff --git a/TODO.md b/TODO.md index ae45cce5..af6cbac0 100644 --- a/TODO.md +++ b/TODO.md @@ -4,6 +4,7 @@ - Exam results reviewing += Fix RTS results link for logged in users # Ongoing diff --git a/anatomy/models.py b/anatomy/models.py index db95e923..82c0e8a5 100644 --- a/anatomy/models.py +++ b/anatomy/models.py @@ -334,7 +334,7 @@ class Answer(models.Model): if self.answer: self.answer = self.answer.strip() - s = self.answer.lower() + s = " ".join(self.answer.lower().split()) s = s.translate(str.maketrans("", "", string.punctuation)) self.answer_compare = s diff --git a/anatomy/templates/anatomy/exams.html b/anatomy/templates/anatomy/exams.html index 27e654da..ebf76f9a 100644 --- a/anatomy/templates/anatomy/exams.html +++ b/anatomy/templates/anatomy/exams.html @@ -9,6 +9,7 @@ Mark / Scores / Candidates / + Stats / {% endif %} Add New Question {% endblock %} diff --git a/generic/models.py b/generic/models.py index 3a061dad..819de14d 100644 --- a/generic/models.py +++ b/generic/models.py @@ -880,7 +880,7 @@ class ExamBase(ExamCollectionGenericBase):

{exam_name}

Results

- Score: {user_score} / {int(self.stats_max_possible)} ({percentage}) + Score: {user_score} / {int(self.stats_max_possible)} {percentage}

Stats

{stats}
diff --git a/generic/views.py b/generic/views.py index c26eeac8..37c436b9 100644 --- a/generic/views.py +++ b/generic/views.py @@ -979,13 +979,13 @@ class ExamViews(View, LoginRequiredMixin): if not request.user.is_superuser: raise PermissionDenied - cid_users = exam.valid_cid_users.all() - cid_user_count = cid_users.count() + cid_users = exam.valid_cid_users.all()#.order_by("cid")#.prefetch_related("*") + cid_user_count = len(cid_users) - user_users = exam.valid_user_users.all() - user_user_count = user_users.count() + user_users = exam.valid_user_users.all()#.order_by("username") + user_user_count = len(user_users) - user_exam_data = exam.cid_users.all() + user_exam_data = exam.cid_users.all().prefetch_related("cid_user", "user_user") context = { "exam": exam, diff --git a/longs/templates/longs/exams.html b/longs/templates/longs/exams.html index 6260201b..c892d469 100644 --- a/longs/templates/longs/exams.html +++ b/longs/templates/longs/exams.html @@ -8,4 +8,5 @@ Mark / Scores / Candidates / + Stats / {% endblock %} diff --git a/physics/templates/physics/exams.html b/physics/templates/physics/exams.html index 5ce6582c..6f2f8b70 100644 --- a/physics/templates/physics/exams.html +++ b/physics/templates/physics/exams.html @@ -5,5 +5,6 @@
Exams: {{exam.name}}-> Overview / Scores / -Candidates +Candidates / + Stats / {% endblock %} \ No newline at end of file diff --git a/rapids/templates/rapids/exams.html b/rapids/templates/rapids/exams.html index 301db95a..12425d1d 100644 --- a/rapids/templates/rapids/exams.html +++ b/rapids/templates/rapids/exams.html @@ -9,6 +9,7 @@ Mark / Scores / Candidates / + Stats / {% endif %} Add New Question {% endblock %} diff --git a/sbas/templates/sbas/exams.html b/sbas/templates/sbas/exams.html index b6675e02..737c770b 100644 --- a/sbas/templates/sbas/exams.html +++ b/sbas/templates/sbas/exams.html @@ -7,4 +7,5 @@ Overview / Scores / Candidates / + Stats / {% endblock %} diff --git a/templates/exam_stats.html b/templates/exam_stats.html index 564b3b2d..39919122 100644 --- a/templates/exam_stats.html +++ b/templates/exam_stats.html @@ -1,19 +1,11 @@ {% extends 'base.html' %} {% block content %} -

{{exam.name}}

- - +

{{exam.name}}: Stats

{% if exam.stats_candidates < 4 %} Not enough data points... {% else %} - -
{{exam.stats_graph|safe}}
- - Available marks: {{exam.stats_max_possible}}
- Mean: {{exam.stats_mean}}, Median {{exam.stats_median}}, Mode {{exam.stats_mode}}
- Top score: {{exam.stats_max}} - + {% include "exam_stats_block.html" %}

Note: scores < 10% of the total score are excluded from these statistics {% endif %} {% endblock %} \ No newline at end of file diff --git a/templates/exam_stats_block.html b/templates/exam_stats_block.html new file mode 100644 index 00000000..ff9679c8 --- /dev/null +++ b/templates/exam_stats_block.html @@ -0,0 +1,5 @@ +

{{exam.stats_graph|safe}}
+ + Available marks: {{exam.stats_max_possible}}
+ Mean: {{exam.stats_mean}}, Median {{exam.stats_median}}, Mode {{exam.stats_mode}}
+ Top score: {{exam.stats_max}}