add boolean fields for controlling feedback/evaluation variations
This commit is contained in:
		
							parent
							
								
									0dee3c28aa
								
							
						
					
					
						commit
						2fc7709c56
					
				
					 3 changed files with 33 additions and 2 deletions
				
			
		|  | @ -55,6 +55,11 @@ class SurveyView(ConceptView): | ||||||
|         if self.editable: |         if self.editable: | ||||||
|             return 'index.html' |             return 'index.html' | ||||||
| 
 | 
 | ||||||
|  |     @Lazy | ||||||
|  |     def showFeedbackText(self): | ||||||
|  |         sft = self.adapted.showFeedbackText | ||||||
|  |         return sft is None and True or sft | ||||||
|  | 
 | ||||||
|     def results(self): |     def results(self): | ||||||
|         result = [] |         result = [] | ||||||
|         response = None |         response = None | ||||||
|  |  | ||||||
|  | @ -38,6 +38,20 @@ class IQuestionnaire(IConceptSchema, interfaces.IQuestionnaire): | ||||||
|         default=4, |         default=4, | ||||||
|         required=True) |         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( |     feedbackHeader = schema.Text( | ||||||
|         title=_(u'Feedback Header'), |         title=_(u'Feedback Header'), | ||||||
|         description=_(u'Text that will appear at the top of the feedback page.'), |         description=_(u'Text that will appear at the top of the feedback page.'), | ||||||
|  |  | ||||||
|  | @ -17,13 +17,25 @@ | ||||||
|     <table class="listing"> |     <table class="listing"> | ||||||
|       <tr> |       <tr> | ||||||
|         <th i18n:translate="">Category</th> |         <th i18n:translate="">Category</th> | ||||||
|         <th i18n:translate="">Response</th> |         <th tal:condition="item/showFeedbackText" | ||||||
|  |             i18n:translate="">Response</th> | ||||||
|         <th i18n:translate="">%</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> | ||||||
|       <tr tal:repeat="fbitem feedback"> |       <tr tal:repeat="fbitem feedback"> | ||||||
|         <td tal:content="fbitem/category" /> |         <td tal:content="fbitem/category" /> | ||||||
|         <td tal:content="fbitem/text" /> |         <td tal:condition="item/showFeedbackText" | ||||||
|  |             tal:content="fbitem/text" /> | ||||||
|         <td tal:content="fbitem/score" /> |         <td tal:content="fbitem/score" /> | ||||||
|  |         <tal:team condition="item/adapted/showTeamResults"> | ||||||
|  |           <td /> | ||||||
|  |           <td /> | ||||||
|  |           <td /> | ||||||
|  |         </tal:team> | ||||||
|       </tr> |       </tr> | ||||||
|     </table> |     </table> | ||||||
|     <div class="button" id="show_questionnaire"> |     <div class="button" id="show_questionnaire"> | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue