1 from django import template
3 register = template.Library()
7 def csv_header(exercise_id, submissionSet):
8 examiners = submissionSet.examiners_by_exercise.get(exercise_id, [])
9 examiners_string = ','.join(['zad %s - %s' % (exercise_id, user.username) for user in examiners])
10 toret = ',zad %s' % exercise_id
12 toret += ',' + examiners_string
16 def csv_row_fragment(exercise_id, submission, submissionSet):
17 final_mark = submission.get_final_exercise_mark(exercise_id)
18 toret = str(final_mark) if isinstance(final_mark, int) else '-'
19 examiners = submissionSet.examiners_by_exercise.get(exercise_id, [])
20 marks_by_examiner = submission.get_exercise_marks_by_examiner(exercise_id)
21 for examiner in examiners:
22 mark = marks_by_examiner.get(str(examiner.id), None)