provide column for standard deviation on single question report - but keep inactive at the moment
This commit is contained in:
parent
ae789e117b
commit
38d74bcb21
4 changed files with 13 additions and 0 deletions
|
@ -23,6 +23,7 @@ surveys and self-assessments.
|
||||||
|
|
||||||
import csv
|
import csv
|
||||||
from cStringIO import StringIO
|
from cStringIO import StringIO
|
||||||
|
import math
|
||||||
from zope.app.pagetemplate import ViewPageTemplateFile
|
from zope.app.pagetemplate import ViewPageTemplateFile
|
||||||
from zope.cachedescriptors.property import Lazy
|
from zope.cachedescriptors.property import Lazy
|
||||||
from zope.i18n import translate
|
from zope.i18n import translate
|
||||||
|
@ -269,8 +270,12 @@ class SurveyView(InstitutionMixin, ConceptView):
|
||||||
average = float(sum(values)) / len(values)
|
average = float(sum(values)) / len(values)
|
||||||
if question.revertAnswerOptions:
|
if question.revertAnswerOptions:
|
||||||
average = question.answerRange - average - 1
|
average = question.answerRange - average - 1
|
||||||
|
devs = [(average - v) for v in values]
|
||||||
|
stddev = math.sqrt(sum(d * d for d in devs) / len(values))
|
||||||
average = average * 100 / (question.answerRange - 1)
|
average = average * 100 / (question.answerRange - 1)
|
||||||
|
stddev = stddev * 100 / (question.answerRange - 1)
|
||||||
result['average'] = int(round(average))
|
result['average'] = int(round(average))
|
||||||
|
result['stddev'] = int(round(stddev))
|
||||||
texts = [r.texts.get(question) for r in self.teamData]
|
texts = [r.texts.get(question) for r in self.teamData]
|
||||||
result['texts'] = '<br />'.join([unicode(t) for t in texts if t])
|
result['texts'] = '<br />'.join([unicode(t) for t in texts if t])
|
||||||
return result
|
return result
|
||||||
|
|
|
@ -178,10 +178,12 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
|
<!--<td> </td>-->
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="vpad">
|
<tr class="vpad">
|
||||||
<td><b tal:content="group/title" /></td>
|
<td><b tal:content="group/title" /></td>
|
||||||
<td i18n:translate="">Average</td>
|
<td i18n:translate="">Average</td>
|
||||||
|
<!--<td i18n:translate="">Deviation</td>-->
|
||||||
</tr>
|
</tr>
|
||||||
<tr tal:repeat="question group/questions">
|
<tr tal:repeat="question group/questions">
|
||||||
<tal:question
|
<tal:question
|
||||||
|
@ -197,6 +199,9 @@
|
||||||
<td class="center">
|
<td class="center">
|
||||||
<span tal:condition="python:qutype == 'value_selection'"
|
<span tal:condition="python:qutype == 'value_selection'"
|
||||||
tal:content="data/average" /></td>
|
tal:content="data/average" /></td>
|
||||||
|
<!--<td class="center">
|
||||||
|
<span tal:condition="python:qutype == 'value_selection'"
|
||||||
|
tal:content="data/stddev" /></td>-->
|
||||||
</tal:question>
|
</tal:question>
|
||||||
</tr>
|
</tr>
|
||||||
</tal:group>
|
</tal:group>
|
||||||
|
|
Binary file not shown.
|
@ -342,6 +342,9 @@ msgstr "Rang Team"
|
||||||
msgid "Average"
|
msgid "Average"
|
||||||
msgstr "Durchschnitt"
|
msgstr "Durchschnitt"
|
||||||
|
|
||||||
|
msgid "Deviation"
|
||||||
|
msgstr "Abweichung"
|
||||||
|
|
||||||
msgid "Team Size"
|
msgid "Team Size"
|
||||||
msgstr "Anzahl der vom Team ausgefüllten Fragebögen"
|
msgstr "Anzahl der vom Team ausgefüllten Fragebögen"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue