add boolean fields for controlling feedback/evaluation variations

This commit is contained in:
Helmut Merz 2014-04-29 17:06:19 +02:00
parent 0dee3c28aa
commit 2fc7709c56
3 changed files with 33 additions and 2 deletions

View file

@ -55,6 +55,11 @@ class SurveyView(ConceptView):
if self.editable:
return 'index.html'
@Lazy
def showFeedbackText(self):
sft = self.adapted.showFeedbackText
return sft is None and True or sft
def results(self):
result = []
response = None

View file

@ -38,6 +38,20 @@ class IQuestionnaire(IConceptSchema, interfaces.IQuestionnaire):
default=4,
required=True)
showFeedbackText = schema.Bool(
title=_(u'Show Feedback Text'),
description=_(u'If not set no feedback text will be shown on '
u'the results page.'),
default=True,
required=False)
showTeamResults = schema.Bool(
title=_(u'Show Team Results'),
description=_(u'If set the team-related columns will be shown on '
u'the results page.'),
default=False,
required=False)
feedbackHeader = schema.Text(
title=_(u'Feedback Header'),
description=_(u'Text that will appear at the top of the feedback page.'),

View file

@ -17,13 +17,25 @@
<table class="listing">
<tr>
<th i18n:translate="">Category</th>
<th i18n:translate="">Response</th>
<th tal:condition="item/showFeedbackText"
i18n:translate="">Response</th>
<th i18n:translate="">%</th>
<tal:team condition="item/adapted/showTeamResults">
<th i18n:translate="">Rank</th>
<th i18n:translate="">Team Score %</th>
<th i18n:translate="">Team Rank</th>
</tal:team>
</tr>
<tr tal:repeat="fbitem feedback">
<td tal:content="fbitem/category" />
<td tal:content="fbitem/text" />
<td tal:condition="item/showFeedbackText"
tal:content="fbitem/text" />
<td tal:content="fbitem/score" />
<tal:team condition="item/adapted/showTeamResults">
<td />
<td />
<td />
</tal:team>
</tr>
</table>
<div class="button" id="show_questionnaire">