Package com.agiletec.plugins.jpsurvey.aps.internalservlet.model

Examples of com.agiletec.plugins.jpsurvey.aps.internalservlet.model.CurrentVotingInfoBean


  @Override
  public String initQuestion() {
    try {
      this.setInsertedFreeText(null);
      this.setChoiceIds(new ArrayList<Integer>());
      CurrentVotingInfoBean currentVotingInfoBean = this.getCurrentVotingInfoBean();
      int currentIndexInt = this.getCurrentQuestionIndex().intValue()+1;
      if (currentIndexInt != currentVotingInfoBean.getCurrentQuestionIndex()) {
        //Check REFRESH
        return SUCCESS;
      }
      Survey survey = this.getVoterResponse().getSurvey();
      if (survey.getQuestions().size() == currentIndexInt) {
View Full Code Here


  }
 
  @Override
  public String saveResponse() {
    try {
      CurrentVotingInfoBean currentVotingInfoBean = this.getCurrentVotingInfoBean();
      int currentIndexInt = this.getCurrentQuestionIndex().intValue();
      if (currentIndexInt != currentVotingInfoBean.getCurrentQuestionIndex()) {
        //Check REFRESH
        return SUCCESS;
      }
      Question question = this.getCurrentQuestion();
      for (int i=0; i<this.getChoiceIds().size(); i++) {
        Integer choiceId = this.getChoiceIds().get(i);
        SingleQuestionResponse singleResponse = new SingleQuestionResponse();
        singleResponse.setChoiceId(choiceId);
        singleResponse.setQuestionId(question.getId());
        Choice choice = question.getChoice(choiceId);
        if (choice.isFreeText()) {
          singleResponse.setFreeText(this.getInsertedFreeText().trim());
        }
        currentVotingInfoBean.getVoterResponse().getResponses().add(singleResponse);
      }
      currentVotingInfoBean.setNextIndex();
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "saveResponse", "Error saving response");
      return FAILURE;
    }
    return SUCCESS;
View Full Code Here

   
    return invocation.invoke();
  }
 
  protected VoterResponse getVoterResponse(HttpServletRequest request) {
    CurrentVotingInfoBean infoBean = this.getCurrentVotingInfoBean(request);
    if (null == infoBean) return null;
    return infoBean.getVoterResponse();
  }
View Full Code Here

      this.getRequest().getSession().removeAttribute(ApsAdminSurveySystemConstants.SURVEY_CURRENT_VOTING_INFO_SESSION_PARAM);
      this.getRequest().getSession().removeAttribute(ApsAdminSurveySystemConstants.SURVEY_CURRENT_QUESTION_INDEX_SESSION_PARAM);
      survey = this.getSurveyManager().loadSurvey(this.getSurveyId());
      Voter voter = this.createVoter();
     
      CurrentVotingInfoBean currentVotingInfoBean = new CurrentVotingInfoBean(survey, voter);
      this.getRequest().getSession().setAttribute(ApsAdminSurveySystemConstants.SURVEY_CURRENT_VOTING_INFO_SESSION_PARAM, currentVotingInfoBean);
      this.getRequest().getSession().setAttribute(ApsAdminSurveySystemConstants.SURVEY_CURRENT_QUESTION_INDEX_SESSION_PARAM, new Integer(-1));
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "startSurvey");
      return FAILURE;
View Full Code Here

TOP

Related Classes of com.agiletec.plugins.jpsurvey.aps.internalservlet.model.CurrentVotingInfoBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.