From 963ec6666865c661bb53519cce3f96b9c5fdd0a3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Wed, 13 Nov 2013 13:21:11 +0100 Subject: [PATCH] Fixing admin results report --- wtem/models.py | 2 +- wtem/templatetags/wtem_csv.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/wtem/models.py b/wtem/models.py index 5325a58..56c814c 100644 --- a/wtem/models.py +++ b/wtem/models.py @@ -83,7 +83,7 @@ class Submission(models.Model): if exercise_checked_manually(exercise): marks_by_examiner = self.get_exercise_marks_by_examiner(exercise_id) if len(marks_by_examiner): - return max(marks_by_examiner.values()) + return max(map(int, marks_by_examiner.values())) else: return None else: diff --git a/wtem/templatetags/wtem_csv.py b/wtem/templatetags/wtem_csv.py index 9d444e7..be3a905 100644 --- a/wtem/templatetags/wtem_csv.py +++ b/wtem/templatetags/wtem_csv.py @@ -14,11 +14,12 @@ def csv_header(exercise_id, submissionSet): @register.simple_tag def csv_row_fragment(exercise_id, submission, submissionSet): - toret = '%s' % submission.final_result - examiners = submissionSet.examiners_by_exercise[exercise_id] + final_mark = submission.get_final_exercise_mark(exercise_id) + toret = str(final_mark) if isinstance(final_mark, int) else '-' + examiners = submissionSet.examiners_by_exercise.get(exercise_id, []) marks_by_examiner = submission.get_exercise_marks_by_examiner(exercise_id) for examiner in examiners: - mark = marks_by_examiner[examiner.id] + mark = marks_by_examiner.get(str(examiner.id), None) toret += ',' if mark is None: toret += '-' -- 2.20.1