Search in sources :

Example 1 with Choice

use of org.motechproject.mots.domain.Choice in project mots by motech-implementations.

the class ModuleMapper method fromDto.

List<Choice> fromDto(List<ChoiceDto> choiceDtos) {
    List<Choice> choices = new ArrayList<>();
    if (choiceDtos != null) {
        for (int i = 0; i < choiceDtos.size(); i++) {
            Choice choice = fromDto(choiceDtos.get(i));
            choice.setIsCorrect(BooleanUtils.isTrue(choice.getIsCorrect()));
            choice.setChoiceId(i + 1);
            choices.add(choice);
        }
    }
    return choices;
}
Also used : Choice(org.motechproject.mots.domain.Choice) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 Choice (org.motechproject.mots.domain.Choice)1