예제 #1
0
 public QuestionTemplateDto build() {
   if (question.getType() == QuestionTypeEnum.SINGLE_CHOICE) {
     for (AnswerTemplateDto answer : question.getAnswers()) {
       answer.setExcludesOtherAnswers(true);
     }
   }
   return question;
 }
예제 #2
0
 public QuestionBuilder(QuestionTypeEnum type, String text) {
   question.setType(type);
   question.setText(text);
 }
예제 #3
0
 public QuestionBuilder withAnswers(AnswerBuilder... answers) {
   for (AnswerBuilder answerBuilder : answers) {
     question.getAnswers().add(answerBuilder.build());
   }
   return this;
 }