Search in sources :

Example 11 with ResponseCondition

use of uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseCondition 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 12 with ResponseCondition

use of uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseCondition 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 13 with ResponseCondition

use of uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseCondition in project OpenOLAT by OpenOLAT.

the class HottextAssessmentItemBuilder method buildMainScoreRule.

@Override
protected void buildMainScoreRule(List<OutcomeDeclaration> outcomeDeclarations, List<ResponseRule> responseRules) {
    ResponseCondition rule = new ResponseCondition(assessmentItem.getResponseProcessing());
    responseRules.add(0, rule);
    if (scoreEvaluation == ScoreEvaluation.perAnswer) {
        buildMainScoreRulePerAnswer(rule);
    } else {
        buildMainScoreRuleAllCorrectAnswers(rule);
    }
}
Also used : ResponseCondition(uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseCondition)

Example 14 with ResponseCondition

use of uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseCondition in project OpenOLAT by OpenOLAT.

the class LobAssessmentItemBuilder method buildMainScoreRule.

@Override
protected void buildMainScoreRule(List<OutcomeDeclaration> outcomeDeclarations, List<ResponseRule> responseRules) {
    ResponseCondition rule = new ResponseCondition(assessmentItem.getResponseProcessing());
    responseRules.add(0, rule);
    buildMainEssayFeedbackRule(rule);
}
Also used : ResponseCondition(uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseCondition)

Example 15 with ResponseCondition

use of uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseCondition in project OpenOLAT by OpenOLAT.

the class MultipleChoiceAssessmentItemBuilder method buildMainScoreRule.

@Override
protected void buildMainScoreRule(List<OutcomeDeclaration> outcomeDeclarations, List<ResponseRule> responseRules) {
    ResponseCondition rule = new ResponseCondition(assessmentItem.getResponseProcessing());
    responseRules.add(0, rule);
    if (scoreEvaluation == ScoreEvaluation.perAnswer) {
        buildMainScoreRulePerAnswer(rule);
    } else {
        buildMainScoreRuleAllCorrectAnswers(rule);
    }
}
Also used : ResponseCondition(uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseCondition)

Aggregations

ResponseCondition (uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseCondition)54 ResponseIf (uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseIf)28 SetOutcomeValue (uk.ac.ed.ph.jqtiplus.node.item.response.processing.SetOutcomeValue)28 Variable (uk.ac.ed.ph.jqtiplus.node.expression.general.Variable)22 BaseValue (uk.ac.ed.ph.jqtiplus.node.expression.general.BaseValue)18 And (uk.ac.ed.ph.jqtiplus.node.expression.operator.And)16 Match (uk.ac.ed.ph.jqtiplus.node.expression.operator.Match)10 IdentifierValue (uk.ac.ed.ph.jqtiplus.value.IdentifierValue)10 ModalFeedback (uk.ac.ed.ph.jqtiplus.node.item.ModalFeedback)8 ArrayList (java.util.ArrayList)6 Expression (uk.ac.ed.ph.jqtiplus.node.expression.Expression)6 Correct (uk.ac.ed.ph.jqtiplus.node.expression.general.Correct)6 Equal (uk.ac.ed.ph.jqtiplus.node.expression.operator.Equal)6 IsNull (uk.ac.ed.ph.jqtiplus.node.expression.operator.IsNull)6 Multiple (uk.ac.ed.ph.jqtiplus.node.expression.operator.Multiple)6 Sum (uk.ac.ed.ph.jqtiplus.node.expression.operator.Sum)6 ResponseRule (uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseRule)6 ComplexReferenceIdentifier (uk.ac.ed.ph.jqtiplus.types.ComplexReferenceIdentifier)6 FloatValue (uk.ac.ed.ph.jqtiplus.value.FloatValue)6 MapResponse (uk.ac.ed.ph.jqtiplus.node.expression.general.MapResponse)4