From: Aleksander Ɓukasz Date: Wed, 13 Nov 2013 12:21:11 +0000 (+0100) Subject: Fixing admin results report X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/963ec6666865c661bb53519cce3f96b9c5fdd0a3 Fixing admin results report --- 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 += '-'