equal
deleted
inserted
replaced
504 survey_form = self._getSurveyTakeForm(entity, survey_record, params, |
504 survey_form = self._getSurveyTakeForm(entity, survey_record, params, |
505 request.POST) |
505 request.POST) |
506 |
506 |
507 # fill context with the survey_form and additional information |
507 # fill context with the survey_form and additional information |
508 context['survey_form'] = survey_form |
508 context['survey_form'] = survey_form |
509 self.setHelpAndStatus(context, entity, survey_record) |
509 self._setSurveyTakeContext(request, params, context, entity, survey_record) |
510 |
510 |
511 if request.POST: |
511 if request.POST: |
512 return self.takePost(request, template, context, params, survey_form, |
512 return self.takePost(request, template, context, params, survey_form, |
513 entity, survey_record, **kwargs) |
513 entity, survey_record, **kwargs) |
514 else: #request.GET |
514 else: #request.GET |
640 record: a SurveyRecord entity |
640 record: a SurveyRecord entity |
641 properties: properties to be stored in the SurveyRecord entity |
641 properties: properties to be stored in the SurveyRecord entity |
642 """ |
642 """ |
643 pass |
643 pass |
644 |
644 |
645 |
645 def _setSurveyTakeContext(self, request, params, context, survey, |
646 def setHelpAndStatus(self, context, survey, survey_record): |
646 survey_record): |
647 """Get help_text and status for template use. |
647 """Sets the help_text and status for take template use. |
648 |
648 |
649 Args: |
649 Args: |
|
650 request: HTTP request object |
|
651 params: the params for the current View |
650 context: the context for the view to update |
652 context: the context for the view to update |
651 survey: a Survey entity |
653 survey: a Survey entity |
652 survey_record: a SurveyRecordEntity |
654 survey_record: a SurveyRecordEntity iff exists |
653 """ |
655 """ |
654 |
656 |
655 if not survey.survey_end: |
657 if not survey.survey_end: |
656 survey_end_text = "" |
658 survey_end_text = "" |
657 else: |
659 else: |