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 if final_mark is not None:
19 final_mark = ('%.2f' % final_mark).rstrip('0').rstrip('.')
20 toret = final_mark if final_mark else '-'
21 examiners = submissionSet.examiners_by_exercise.get(exercise_id, [])
22 marks_by_examiner = submission.get_exercise_marks_by_examiner(exercise_id)
23 for examiner in examiners:
24 mark = marks_by_examiner.get(str(examiner.id), None)