示例#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;
 }