rearrange answer options; allow for unanswered questions; intermediate question group headings
This commit is contained in:
parent
ac144b99a3
commit
74988c1834
5 changed files with 86 additions and 42 deletions
|
@ -52,9 +52,10 @@ class SurveyView(ConceptView):
|
||||||
if key.startswith('question_'):
|
if key.startswith('question_'):
|
||||||
uid = key[len('question_'):]
|
uid = key[len('question_'):]
|
||||||
question = adapted(self.getObjectForUid(uid))
|
question = adapted(self.getObjectForUid(uid))
|
||||||
value = int(value)
|
if value != 'none':
|
||||||
self.data[uid] = value
|
value = int(value)
|
||||||
response.values[question] = value
|
self.data[uid] = value
|
||||||
|
response.values[question] = value
|
||||||
# TODO: store self.data in track
|
# TODO: store self.data in track
|
||||||
# else:
|
# else:
|
||||||
# get response from track
|
# get response from track
|
||||||
|
@ -65,9 +66,10 @@ class SurveyView(ConceptView):
|
||||||
for r in result]
|
for r in result]
|
||||||
|
|
||||||
def getValues(self, question):
|
def getValues(self, question):
|
||||||
setting = 0
|
setting = None
|
||||||
if self.data is not None:
|
if self.data is not None:
|
||||||
setting = self.data.get(question.uid) or 0
|
setting = self.data.get(question.uid)
|
||||||
return [dict(value=i, checked=(i == setting))
|
noAnswer = [dict(value='none', checked=(setting == None))]
|
||||||
for i in range(question.answerRange)]
|
return noAnswer + [dict(value=i, checked=(setting == i))
|
||||||
|
for i in reversed(range(question.answerRange))]
|
||||||
|
|
||||||
|
|
|
@ -43,11 +43,24 @@ class IQuestionGroup(IConceptSchema, interfaces.IQuestionGroup):
|
||||||
""" A group of questions within a questionnaire.
|
""" A group of questions within a questionnaire.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
minAnswers = schema.Int(
|
||||||
|
title=_(u'Minimum Number of Answers'),
|
||||||
|
description=_(u'Minumum number of questions that have to be answered. '
|
||||||
|
'Empty means all questions have to be answered.'),
|
||||||
|
default=4,
|
||||||
|
required=False)
|
||||||
|
|
||||||
|
|
||||||
class IQuestion(IConceptSchema, interfaces.IQuestion):
|
class IQuestion(IConceptSchema, interfaces.IQuestion):
|
||||||
""" A single question within a questionnaire.
|
""" A single question within a questionnaire.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
required = schema.Bool(
|
||||||
|
title=_(u'Required'),
|
||||||
|
description=_(u'Question must be answered.'),
|
||||||
|
default=False,
|
||||||
|
required=False)
|
||||||
|
|
||||||
revertAnswerOptions = schema.Bool(
|
revertAnswerOptions = schema.Bool(
|
||||||
title=_(u'Negative'),
|
title=_(u'Negative'),
|
||||||
description=_(u'Value inversion: High selection means low value.'),
|
description=_(u'Value inversion: High selection means low value.'),
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<metal:title use-macro="item/conceptMacros/concepttitle" />
|
<metal:title use-macro="item/conceptMacros/concepttitle" />
|
||||||
<div tal:condition="feedback">
|
<div tal:condition="feedback">
|
||||||
<h3 i18n:translate="">Feedback</h3>
|
<h3 i18n:translate="">Feedback</h3>
|
||||||
<table>
|
<table class="listing">
|
||||||
<tr>
|
<tr>
|
||||||
<th i18n:translate="">Category</th>
|
<th i18n:translate="">Category</th>
|
||||||
<th i18n:translate="">Response</th>
|
<th i18n:translate="">Response</th>
|
||||||
|
@ -23,33 +23,32 @@
|
||||||
</div>
|
</div>
|
||||||
<h3 i18n:translate="">Questionnaire</h3>
|
<h3 i18n:translate="">Questionnaire</h3>
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<table>
|
<table class="listing">
|
||||||
<tr>
|
<tal:qugroup repeat="qugroup item/adapted/questionGroups">
|
||||||
<th></th>
|
<tr>
|
||||||
<th>
|
<td><b tal:content="qugroup/title" /></td>
|
||||||
<table>
|
<td style="text-align: center"
|
||||||
<tr>
|
i18n:translate="">No answer</td>
|
||||||
<td i18n:translate="">Does not apply</td>
|
<td colspan="2"
|
||||||
<td style="text-align: right"
|
i18n:translate="">Fully applies</td>
|
||||||
i18n:translate="">Fully applies</td>
|
<td colspan="2"
|
||||||
</tr>
|
style="text-align: right"
|
||||||
</table>
|
i18n:translate="">Does not apply</td>
|
||||||
</th>
|
</tr>
|
||||||
</tr>
|
<tr tal:repeat="question qugroup/questions">
|
||||||
<tr tal:repeat="question item/adapted/questions">
|
<td tal:content="question/text" />
|
||||||
<td tal:content="question/text" />
|
<td style="white-space: nowrap; text-align: center"
|
||||||
<td style="white-space: nowrap">
|
tal:repeat="value python:item.getValues(question)">
|
||||||
<span tal:repeat="value python:item.getValues(question)">
|
<input type="radio"
|
||||||
<input type="radio"
|
i18n:attributes="title"
|
||||||
i18n:attributes="title"
|
tal:attributes="
|
||||||
tal:attributes="
|
name string:question_${question/uid};
|
||||||
name string:question_${question/uid};
|
value value/value;
|
||||||
value value/value;
|
checked value/checked;
|
||||||
checked value/checked;
|
title string:survey_value_${value/value}" />
|
||||||
title string:survey_value_${value/value}" />
|
</td>
|
||||||
</span>
|
</tr>
|
||||||
</td>
|
</tal:qugroup>
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
<br />
|
<br />
|
||||||
<input type="submit" name="submit" value="Evaluate Questionnaire"
|
<input type="submit" name="submit" value="Evaluate Questionnaire"
|
||||||
|
|
Binary file not shown.
|
@ -3,7 +3,7 @@ msgstr ""
|
||||||
|
|
||||||
"Project-Id-Version: 0.13.0\n"
|
"Project-Id-Version: 0.13.0\n"
|
||||||
"POT-Creation-Date: 2007-05-22 12:00 CET\n"
|
"POT-Creation-Date: 2007-05-22 12:00 CET\n"
|
||||||
"PO-Revision-Date: 2013-03-07 12:00 CET\n"
|
"PO-Revision-Date: 2013-03-18 12:00 CET\n"
|
||||||
"Last-Translator: Helmut Merz <helmutm@cy55.de>\n"
|
"Last-Translator: Helmut Merz <helmutm@cy55.de>\n"
|
||||||
"Language-Team: loops developers <helmutm@cy55.de>\n"
|
"Language-Team: loops developers <helmutm@cy55.de>\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
|
@ -178,8 +178,20 @@ msgstr "Abstufung Bewertungen"
|
||||||
msgid "Number of items (answer options) to select from."
|
msgid "Number of items (answer options) to select from."
|
||||||
msgstr "Anzahl der Abstufungen, aus denen bei der Antwort gewählt werden kann."
|
msgstr "Anzahl der Abstufungen, aus denen bei der Antwort gewählt werden kann."
|
||||||
|
|
||||||
msgid "Negativ"
|
msgid "Minimum Number of Answers"
|
||||||
msgstr "Negativbewertung"
|
msgstr "Mindestanzahl an Antworten"
|
||||||
|
|
||||||
|
msgid "Minumum number of questions that have to be answered. Empty means all questions have to be answered."
|
||||||
|
msgstr "Anzahl der Fragen, die mindestens beantwortet werden müssen. Keine Angabe: Es müssen alle Fragen beantwortet werden."
|
||||||
|
|
||||||
|
msgid "Required"
|
||||||
|
msgstr "Erforderlich"
|
||||||
|
|
||||||
|
msgid "Question must be answered."
|
||||||
|
msgstr "Frage muss unbedingt beantwortet werden."
|
||||||
|
|
||||||
|
msgid "Negative"
|
||||||
|
msgstr "Negative Polarität"
|
||||||
|
|
||||||
msgid "Value inversion: High selection means low value."
|
msgid "Value inversion: High selection means low value."
|
||||||
msgstr "Invertierung der Bewertung: Hohe gewählte Stufe bedeutet niedriger Wert."
|
msgstr "Invertierung der Bewertung: Hohe gewählte Stufe bedeutet niedriger Wert."
|
||||||
|
@ -196,27 +208,45 @@ msgstr "Kategorie"
|
||||||
msgid "Response"
|
msgid "Response"
|
||||||
msgstr "Beurteilung"
|
msgstr "Beurteilung"
|
||||||
|
|
||||||
|
msgid "No answer"
|
||||||
|
msgstr "Keine Antwort"
|
||||||
|
|
||||||
msgid "Does not apply"
|
msgid "Does not apply"
|
||||||
msgstr "Trifft nicht zu"
|
msgstr "Trifft nicht zu"
|
||||||
|
|
||||||
msgid "Fully applies"
|
msgid "Fully applies"
|
||||||
msgstr "Trifft voll zu"
|
msgstr "Trifft voll zu"
|
||||||
|
|
||||||
|
msgid "survey_value_none"
|
||||||
|
msgstr "Keine Antwort"
|
||||||
|
|
||||||
msgid "survey_value_0"
|
msgid "survey_value_0"
|
||||||
msgstr "trifft für unser Unternehmen überhaupt nicht zu"
|
msgstr "Trifft für unser Unternehmen überhaupt nicht zu"
|
||||||
|
|
||||||
msgid "survey_value_1"
|
msgid "survey_value_1"
|
||||||
msgstr "trifft eher nicht zu"
|
msgstr "Trifft eher nicht zu"
|
||||||
|
|
||||||
msgid "survey_value_2"
|
msgid "survey_value_2"
|
||||||
msgstr "trifft eher zu"
|
msgstr "Trifft eher zu"
|
||||||
|
|
||||||
msgid "survey_value_3"
|
msgid "survey_value_3"
|
||||||
msgstr "trifft für unser Unternehmen voll und ganz zu"
|
msgstr "Trifft für unser Unternehmen voll und ganz zu"
|
||||||
|
|
||||||
msgid "Evaluate Questionnaire"
|
msgid "Evaluate Questionnaire"
|
||||||
msgstr "Fragebogen auswerten"
|
msgstr "Fragebogen auswerten"
|
||||||
|
|
||||||
|
msgid "Please answer at least $minAnswers questions."
|
||||||
|
msgstr "Bitte beantworten Sie mindestens $minAnswers Fragen."
|
||||||
|
|
||||||
|
msgid "Please answer all questions."
|
||||||
|
msgstr "Bitte beantworten Sie alle Fragen."
|
||||||
|
|
||||||
|
msgid "Please answer the obligatory questions marked with an asterisk."
|
||||||
|
msgstr "Bitte beantworten Sie die mit einem Stern markierten Pflichtfragen."
|
||||||
|
|
||||||
|
msgid "Obligatory question, must be answered"
|
||||||
|
msgstr "Pflichtfrage, muss beantwortet werden"
|
||||||
|
|
||||||
# competence (qualification)
|
# competence (qualification)
|
||||||
|
|
||||||
msgid "Validity Period (Months)"
|
msgid "Validity Period (Months)"
|
||||||
|
|
Loading…
Add table
Reference in a new issue