Search in sources :

Example 6 with ModalFeedback

use of uk.ac.ed.ph.jqtiplus.node.item.ModalFeedback 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 7 with ModalFeedback

use of uk.ac.ed.ph.jqtiplus.node.item.ModalFeedback in project OpenOLAT by OpenOLAT.

the class AssessmentItemBuilder method appendAdditionalFeedback.

protected void appendAdditionalFeedback(ModalFeedbackBuilder feedback, List<ModalFeedback> modalFeedbacks, List<ResponseRule> responseRules) {
    Identifier feedbackIdentifier = feedback.getIdentifier();
    ModalFeedback modalFeedback = AssessmentItemFactory.createModalFeedback(assessmentItem, feedbackIdentifier, feedback.getTitle(), feedback.getText());
    modalFeedbacks.add(modalFeedback);
    Cardinality cardinality = null;
    Identifier responseIdentifier = null;
    if (this instanceof ResponseIdentifierForFeedback) {
        responseIdentifier = ((ResponseIdentifierForFeedback) this).getResponseIdentifier();
        cardinality = assessmentItem.getResponseDeclaration(responseIdentifier).getCardinality();
    }
    ResponseCondition feedbackCondition = AssessmentItemFactory.createModalFeedbackRuleWithConditions(assessmentItem.getResponseProcessing(), feedbackIdentifier, responseIdentifier, cardinality, feedback.getFeedbackConditons());
    responseRules.add(feedbackCondition);
}
Also used : Identifier(uk.ac.ed.ph.jqtiplus.types.Identifier) Cardinality(uk.ac.ed.ph.jqtiplus.value.Cardinality) ModalFeedback(uk.ac.ed.ph.jqtiplus.node.item.ModalFeedback) ResponseCondition(uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseCondition)

Example 8 with ModalFeedback

use of uk.ac.ed.ph.jqtiplus.node.item.ModalFeedback in project OpenOLAT by OpenOLAT.

the class AssessmentItemBuilder method appendModalFeedback.

protected void appendModalFeedback(ModalFeedbackBuilder feedbackBuilder, String inCorrect, List<ModalFeedback> modalFeedbacks, List<ResponseRule> responseRules) {
    ModalFeedback modalFeedback = AssessmentItemFactory.createModalFeedback(assessmentItem, feedbackBuilder.getIdentifier(), feedbackBuilder.getTitle(), feedbackBuilder.getText());
    modalFeedbacks.add(modalFeedback);
    ResponseCondition feedbackCondition = AssessmentItemFactory.createModalFeedbackBasicRule(assessmentItem.getResponseProcessing(), feedbackBuilder.getIdentifier(), inCorrect, hint != null);
    responseRules.add(feedbackCondition);
}
Also used : ModalFeedback(uk.ac.ed.ph.jqtiplus.node.item.ModalFeedback) ResponseCondition(uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseCondition)

Example 9 with ModalFeedback

use of uk.ac.ed.ph.jqtiplus.node.item.ModalFeedback in project openolat by klemens.

the class AssessmentItemBuilder method build.

public final void build() {
    List<OutcomeDeclaration> outcomeDeclarations = assessmentItem.getOutcomeDeclarations();
    outcomeDeclarations.clear();
    ResponseProcessing responseProcessing = assessmentItem.getResponseProcessing();
    List<ResponseRule> responseRules = responseProcessing.getResponseRules();
    responseRules.clear();
    List<ResponseDeclaration> responseDeclarations = assessmentItem.getResponseDeclarations();
    responseDeclarations.clear();
    List<ModalFeedback> modalFeedbacks = assessmentItem.getModalFeedbacks();
    modalFeedbacks.clear();
    buildItemBody();
    buildResponseAndOutcomeDeclarations();
    buildModalFeedbacksAndHints(outcomeDeclarations, responseRules);
    buildMinMaxScores(outcomeDeclarations, responseRules);
    buildMainScoreRule(outcomeDeclarations, responseRules);
    buildHint(outcomeDeclarations, responseRules);
}
Also used : ModalFeedback(uk.ac.ed.ph.jqtiplus.node.item.ModalFeedback) ResponseProcessing(uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseProcessing) OutcomeDeclaration(uk.ac.ed.ph.jqtiplus.node.outcome.declaration.OutcomeDeclaration) ResponseDeclaration(uk.ac.ed.ph.jqtiplus.node.item.response.declaration.ResponseDeclaration) ResponseRule(uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseRule)

Example 10 with ModalFeedback

use of uk.ac.ed.ph.jqtiplus.node.item.ModalFeedback 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

ModalFeedback (uk.ac.ed.ph.jqtiplus.node.item.ModalFeedback)30 Identifier (uk.ac.ed.ph.jqtiplus.types.Identifier)10 ResponseCondition (uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseCondition)8 AssessmentItem (uk.ac.ed.ph.jqtiplus.node.item.AssessmentItem)6 OutcomeDeclaration (uk.ac.ed.ph.jqtiplus.node.outcome.declaration.OutcomeDeclaration)6 ResolvedAssessmentItem (uk.ac.ed.ph.jqtiplus.resolution.ResolvedAssessmentItem)6 ResponseDeclaration (uk.ac.ed.ph.jqtiplus.node.item.response.declaration.ResponseDeclaration)4 ItemSessionState (uk.ac.ed.ph.jqtiplus.state.ItemSessionState)4 URI (java.net.URI)2 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 ModalFeedbackType (org.olat.ims.qti21.model.xml.ModalFeedbackBuilder.ModalFeedbackType)2 P (uk.ac.ed.ph.jqtiplus.node.content.xhtml.text.P)2 BaseValue (uk.ac.ed.ph.jqtiplus.node.expression.general.BaseValue)2 Variable (uk.ac.ed.ph.jqtiplus.node.expression.general.Variable)2 EndAttemptInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.EndAttemptInteraction)2 Interaction (uk.ac.ed.ph.jqtiplus.node.item.interaction.Interaction)2 ResponseIf (uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseIf)2 ResponseProcessing (uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseProcessing)2 ResponseRule (uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseRule)2