fsr-itse/EvaP — pull request #381 by janno42 (2014-08-19 12:59:56+00:00)
Title: Few answers warning

Fixes #285.
For each questionnaire type of a course a median value of the maximum number of voters is calculated.
The result tells for each type of questionnaire (lecturer, tutor, ...) that was used in this course, what the median value of the individual questionnaires' maximum number of participants is.

Results which are based on less than 50% (configurable as ```RESULTS_WARNING_PERCENTAGE``` in the settings) of the median value of the maximum number of voters for this questionnaire get a warning message displayed next to them.
Questionnaires where all questions would have a warning message just show one message on top.

*Example*: There are 3 lecturer questionnaires consisting of 2 questions each and they got this distribution of answers (the maximum is highlighted):

- Lecturer 1:
- Question 1: 5 answers
- Question 2: **7 answers**
- Lecturer 2:
- Question 1: **2 answers**
- Question 2: 1 answer
- Lecturer 3:
- Question 1: **6 answers**
- Question 2: 5 answers

The median value for the lecturer questionnaire is now the median of 7, 2 and 6, which is 6.
50% of 6 is 3, so every question that got less than 3 answers will have a warning.
Because lecturer 2 has a maximum number of voters of 2, all of the questions would have a warning, so they are combined and displayed as one warning on top of the questionnaire.

![warning1](https://cloud.githubusercontent.com/assets/1781719/3966196/69cdd77a-27a0-11e4-8039-9af52cc4c316.PNG)
![warning2](https://cloud.githubusercontent.com/assets/1781719/3966198/6d76bc8e-27a0-11e4-870c-f501a318ccfd.PNG)