Ejemplo n.º 1
0
 public RatingPollingQuestion saveQuestion(RatingPollingQuestion pollingQuestion)
     throws Exception {
   if (voteDao.isRepeatedQuestion(pollingQuestion))
     throw new RepeatedQuestionException("question_is_repeated");
   else if (voteDao.isAnsweredQuestion(pollingQuestion))
     throw new UsedQuestionException("edit_used_question_message");
   else return (RatingPollingQuestion) voteDao.save(pollingQuestion);
 }
Ejemplo n.º 2
0
 public MultipleChoicePollingQuestion saveQuestion(MultipleChoicePollingQuestion pollingQuestion)
     throws Exception {
   if (isRepeatedMultipleChoiceQuestion(pollingQuestion))
     throw new RepeatedQuestionException("question_is_repeated");
   else if (voteDao.isAnsweredQuestion(pollingQuestion))
     throw new UsedQuestionException("edit_used_question_message");
   else {
     return (MultipleChoicePollingQuestion) voteDao.save(pollingQuestion);
   }
 }
Ejemplo n.º 3
0
 public boolean isEditableQuestion(AbstractPollingQuestion pollingQuestion) {
   return !voteDao.isAnsweredQuestion(pollingQuestion);
 }