use of org.mifos.platform.questionnaire.service.QuestionType in project head by mifos.
the class QuestionnaireMapperImpl method mapToSectionDetail.
private SectionDetail mapToSectionDetail(Section section) {
SectionDetail sectionDetail = new SectionDetail();
sectionDetail.setId(section.getId());
sectionDetail.setName(section.getName());
if (section.getSequenceNumber() != null) {
sectionDetail.setSequenceNumber(section.getSequenceNumber());
}
for (SectionQuestion sectionQuestion : section.getQuestions()) {
QuestionEntity question = sectionQuestion.getQuestion();
QuestionType type = mapToQuestionType(question.getAnswerTypeAsEnum());
boolean required = sectionQuestion.isRequired();
QuestionDetail questionDetail = mapToQuestionDetail(question, type);
sectionDetail.addQuestion(mapToSectionQuestionDetail(sectionQuestion, required, sectionQuestion.isShowOnPage(), questionDetail));
}
return sectionDetail;
}
Aggregations