Repository: e-valuation/EvaP

Issue:
Show absolute number of votes and enrollments in export
In the export, each question should not only list the average rating and the variance, but also the number of votes (without "keine Angabe"/not specified).

This information should definitely be displayed in the online version of the results.

Apart from that: Below the final rating ("Gesamtnote"), two additional pieces of information shall be displayed. The first one is the number of submitted questionnaires, which shall be shown under the title "Abgegebene Fragebögen"/"Submitted questionnaires". The second one is the number of enrollments, provided under the title "Teilnehmer der Lehrveranstaltung"/"Participants of the course".



Discussion:
ref #204 


Resolving patch:
diff --git a/evap/fsr/importers.py b/evap/fsr/importers.py
--- a/evap/fsr/importers.py
+++ b/evap/fsr/importers.py
@@ -160,9 +160,7 @@ def save_enrollments_to_db(self, semester, vote_start_date, vote_end_date):
                     course.participants.add(student)
 
                 except Exception, e:
-                    messages.warning(self.request, _("A problem occured while writing the entries to the database. " \
-                                                     "The original data location was row %(row)d of sheet '%(sheet)s'. " \
-                                                     "The error message has been: '%(error)s'") % dict(row=row, sheet=sheet, error=e))
+                    messages.warning(self.request, _("A problem occured while writing the entries to the database. The original data location was row %(row)d of sheet '%(sheet)s'. The error message has been: '%(error)s'") % dict(row=row, sheet=sheet, error=e))
                     raise
             messages.info(self.request, _("Successfully created %(courses)d course(s), %(students)d student(s) and %(contributors)d contributor(s).") %
                                             dict(courses=course_count, students=student_count, contributors=contributor_count))
@@ -184,9 +182,7 @@ def save_users_to_db(self):
                         users_count += 1
 
                 except Exception, e:
-                    messages.warning(self.request, _("A problem occured while writing the entries to the database. " \
-                                                     "The original data location was row %(row)d of sheet '%(sheet)s'. " \
-                                                     "The error message has been: '%(error)s'") % dict(row=row, sheet=sheet, error=e))
+                    messages.warning(self.request, _("A problem occured while writing the entries to the database. The original data location was row %(row)d of sheet '%(sheet)s'. The error message has been: '%(error)s'") % dict(row=row, sheet=sheet, error=e))
                     raise
             messages.info(self.request, _("Successfully created %(users)d user(s).") %
                                             dict(users=users_count))
diff --git a/evap/results/exporters.py b/evap/results/exporters.py
--- a/evap/results/exporters.py
+++ b/evap/results/exporters.py
@@ -23,7 +23,7 @@ def __init__(self, semester):
         'headline':      xlwt.easyxf('font: bold on, height 400; alignment: horiz centre, vert centre, wrap on', num_format_str="0.0"),
         'course':        xlwt.easyxf('alignment: horiz centre, wrap on, rota 90; borders: left medium, top medium'),
         'course_unfinished': xlwt.easyxf('alignment: horiz centre, wrap on, rota 90; borders: left medium, top medium; font: italic on'),
-        'total_answers': xlwt.easyxf('alignment: horiz centre; borders: left medium, bottom medium, right medium'),
+        'total_voters': xlwt.easyxf('alignment: horiz centre; borders: left medium, bottom medium, right medium'),
         'bold':          xlwt.easyxf('font: bold on'),
         'border_left':   xlwt.easyxf('borders: left medium'),
         'border_right':  xlwt.easyxf('borders: right medium'),
@@ -166,9 +166,9 @@ def export(self, response, all=False):
             else:
                 self.write_two_empty_cells_with_borders()
 
-        self.writen(_(u"Total Answers"), "bold")
+        self.writen(_(u"Total Voters/Total Participants"), "bold")
         for course, results in courses_with_results:
-            self.writec(course.num_voters, "total_answers", cols=2)
+            self.writec(str(course.num_voters) + "/" + str(course.num_participants) + " ({:.0%})".format(float(course.num_voters)/float(course.num_participants)), "total_voters", cols=2)
 
         self.workbook.save(response)
 


Test patch: