Search in sources :

Example 1 with RightAnswer

use of fi.otavanopisto.muikku.plugins.dnm.parser.content.RightAnswer in project muikku by otavanopisto.

the class FieldTranslator method translateTextField.

public TextFieldMeta translateTextField(String name, Integer columns, Boolean autogrow, List<RightAnswer> rightAnswers, String help, String hint) {
    List<TextFieldRightAnswer> translatedAnswers = new ArrayList<>();
    for (fi.otavanopisto.muikku.plugins.dnm.parser.content.RightAnswer rightAnswer : rightAnswers) {
        Boolean correct = rightAnswer.getPoints() != null && rightAnswer.getPoints() > 0;
        translatedAnswers.add(new TextFieldRightAnswer(rightAnswer.getText(), true, false, correct));
    }
    return new TextFieldMeta(name, columns, autogrow, translatedAnswers, hint);
}
Also used : RightAnswer(fi.otavanopisto.muikku.plugins.dnm.parser.content.RightAnswer) TextFieldMeta(fi.otavanopisto.muikku.plugins.material.fieldmeta.TextFieldMeta) ArrayList(java.util.ArrayList) TextFieldRightAnswer(fi.otavanopisto.muikku.plugins.material.fieldmeta.TextFieldRightAnswer)

Aggregations

RightAnswer (fi.otavanopisto.muikku.plugins.dnm.parser.content.RightAnswer)1 TextFieldMeta (fi.otavanopisto.muikku.plugins.material.fieldmeta.TextFieldMeta)1 TextFieldRightAnswer (fi.otavanopisto.muikku.plugins.material.fieldmeta.TextFieldRightAnswer)1 ArrayList (java.util.ArrayList)1