Class GetUserAnswersMethod

java.lang.Object
ch.tocco.nice2.optional.survey.impl.freemarker.GetUserAnswersMethod
All Implemented Interfaces:
freemarker.template.TemplateMethodModel, freemarker.template.TemplateMethodModelEx, freemarker.template.TemplateModel

public class GetUserAnswersMethod extends Object implements freemarker.template.TemplateMethodModelEx
provides all answers given in the passed Survey_question_answer Entity. This method is a convenient way to get the answers. Resolving the answers 'manually' in freemarker is a pain in the ass. Parameter: surveyQuestionAnswer → Entity of model Survey_question_answer Returns: a simple hash model containing an answer label, an answer and points → UserAnswerEntityModel usage: getSurveyUserAnswers(surveyQuestionAnswer)
  • Constructor Details

    • GetUserAnswersMethod

      public GetUserAnswersMethod(SecurityManager securityManager)
  • Method Details

    • exec

      public Object exec(List args) throws freemarker.template.TemplateModelException
      Specified by:
      exec in interface freemarker.template.TemplateMethodModel
      Specified by:
      exec in interface freemarker.template.TemplateMethodModelEx
      Throws:
      freemarker.template.TemplateModelException
    • setAnswerProviders

      @Autowired public void setAnswerProviders(List<AnswerProvider> answerProviders)