fix in results csv
authorJan Szejko <janek37@gmail.com>
Thu, 24 Nov 2016 10:38:26 +0000 (11:38 +0100)
committerJan Szejko <janek37@gmail.com>
Thu, 24 Nov 2016 10:38:26 +0000 (11:38 +0100)
wtem/admin.py
wtem/templates/wtem/admin_report.csv

index 03c4446..3608628 100644 (file)
@@ -224,6 +224,8 @@ class SubmissionsSet:
                     examiners = self.examiners_by_exercise.setdefault(exercise_id, [])
                     if user not in examiners:
                         examiners.append(user)
+            contact_body = submission.contact.body
+            submission.school = '%s %s' % (contact_body['institution'], contact_body['institution_address'])
 
 
 def report_view(request):
index f97755f..c436b2c 100644 (file)
@@ -1,2 +1,2 @@
-{% load wtem_csv %}email,nazwisko,imie,suma{% for exercise_id in exercise_ids %}{% csv_header exercise_id submissionsSet %}{% endfor %}{% for submission in submissionsSet.submissions %}
-{{submission.email}},{{submission.last_name}},{{submission.first_name}},"{{submission.contact.body.institution}} {{submission.contact.body.institution_address}}",{{submission.final_result_as_string}}{% for exercise_id in exercise_ids %},{% csv_row_fragment exercise_id submission submissionsSet %}{% endfor %}{% endfor %}
\ No newline at end of file
+{% load wtem_csv %}email,nazwisko,imie,szkola,suma{% for exercise_id in exercise_ids %}{% csv_header exercise_id submissionsSet %}{% endfor %}{% for submission in submissionsSet.submissions %}
+{{submission.email}},{{submission.last_name}},{{submission.first_name}},"{{submission.school}}",{{submission.final_result_as_string}}{% for exercise_id in exercise_ids %},{% csv_row_fragment exercise_id submission submissionsSet %}{% endfor %}{% endfor %}
\ No newline at end of file