Search in sources :

Example 1 with ModalFeedbackType

use of org.olat.ims.qti21.model.xml.ModalFeedbackBuilder.ModalFeedbackType in project OpenOLAT by OpenOLAT.

the class AssessmentItemBuilder method extractModalFeedbacks.

private void extractModalFeedbacks() {
    List<ModalFeedback> feedbacks = assessmentItem.getModalFeedbacks();
    for (ModalFeedback feedback : feedbacks) {
        ModalFeedbackBuilder feedbackBuilder = new ModalFeedbackBuilder(assessmentItem, feedback);
        ModalFeedbackType feedbackType = feedbackBuilder.getType();
        if (feedbackType != null && feedbackType != ModalFeedbackType.unkown) {
            switch(feedbackType) {
                case correct:
                    correctFeedback = feedbackBuilder;
                    break;
                case incorrect:
                    incorrectFeedback = feedbackBuilder;
                    break;
                case correctSolution:
                    correctSolutionFeedback = feedbackBuilder;
                    break;
                case empty:
                    emptyFeedback = feedbackBuilder;
                    break;
                case answered:
                    answeredFeedback = feedbackBuilder;
                    break;
                case hint:
                    hint = feedbackBuilder;
                    break;
                case additional:
                    additionalFeedbacks.add(feedbackBuilder);
                    break;
                case unkown:
                    log.error("Unkown feedback:");
                    break;
            }
        }
    }
}
Also used : ModalFeedbackType(org.olat.ims.qti21.model.xml.ModalFeedbackBuilder.ModalFeedbackType) ModalFeedback(uk.ac.ed.ph.jqtiplus.node.item.ModalFeedback)

Example 2 with ModalFeedbackType

use of org.olat.ims.qti21.model.xml.ModalFeedbackBuilder.ModalFeedbackType in project openolat by klemens.

the class AssessmentItemBuilder method extractModalFeedbacks.

private void extractModalFeedbacks() {
    List<ModalFeedback> feedbacks = assessmentItem.getModalFeedbacks();
    for (ModalFeedback feedback : feedbacks) {
        ModalFeedbackBuilder feedbackBuilder = new ModalFeedbackBuilder(assessmentItem, feedback);
        ModalFeedbackType feedbackType = feedbackBuilder.getType();
        if (feedbackType != null && feedbackType != ModalFeedbackType.unkown) {
            switch(feedbackType) {
                case correct:
                    correctFeedback = feedbackBuilder;
                    break;
                case incorrect:
                    incorrectFeedback = feedbackBuilder;
                    break;
                case correctSolution:
                    correctSolutionFeedback = feedbackBuilder;
                    break;
                case empty:
                    emptyFeedback = feedbackBuilder;
                    break;
                case answered:
                    answeredFeedback = feedbackBuilder;
                    break;
                case hint:
                    hint = feedbackBuilder;
                    break;
                case additional:
                    additionalFeedbacks.add(feedbackBuilder);
                    break;
                case unkown:
                    log.error("Unkown feedback:");
                    break;
            }
        }
    }
}
Also used : ModalFeedbackType(org.olat.ims.qti21.model.xml.ModalFeedbackBuilder.ModalFeedbackType) ModalFeedback(uk.ac.ed.ph.jqtiplus.node.item.ModalFeedback)

Aggregations

ModalFeedbackType (org.olat.ims.qti21.model.xml.ModalFeedbackBuilder.ModalFeedbackType)2 ModalFeedback (uk.ac.ed.ph.jqtiplus.node.item.ModalFeedback)2