Search in sources :

Example 21 with OutcomeDeclaration

use of uk.ac.ed.ph.jqtiplus.node.outcome.declaration.OutcomeDeclaration in project openolat by klemens.

the class AssessmentItemFactory method createOutcomeDeclarationForFeedbackBasic.

public static OutcomeDeclaration createOutcomeDeclarationForFeedbackBasic(AssessmentItem assessmentItem) {
    OutcomeDeclaration feedbackOutcomeDeclaration = new OutcomeDeclaration(assessmentItem);
    feedbackOutcomeDeclaration.setIdentifier(QTI21Constants.FEEDBACKBASIC_IDENTIFIER);
    feedbackOutcomeDeclaration.setCardinality(Cardinality.SINGLE);
    feedbackOutcomeDeclaration.setBaseType(BaseType.IDENTIFIER);
    DefaultValue feedbackDefaultVal = new DefaultValue(feedbackOutcomeDeclaration);
    feedbackOutcomeDeclaration.setDefaultValue(feedbackDefaultVal);
    FieldValue feedbackDefaultFieldVal = new FieldValue(feedbackDefaultVal, new IdentifierValue("none"));
    feedbackDefaultVal.getFieldValues().add(feedbackDefaultFieldVal);
    List<View> views = new ArrayList<>();
    views.add(View.TEST_CONSTRUCTOR);
    feedbackOutcomeDeclaration.setViews(views);
    return feedbackOutcomeDeclaration;
}
Also used : DefaultValue(uk.ac.ed.ph.jqtiplus.node.shared.declaration.DefaultValue) ArrayList(java.util.ArrayList) IdentifierValue(uk.ac.ed.ph.jqtiplus.value.IdentifierValue) FieldValue(uk.ac.ed.ph.jqtiplus.node.shared.FieldValue) OutcomeDeclaration(uk.ac.ed.ph.jqtiplus.node.outcome.declaration.OutcomeDeclaration) View(uk.ac.ed.ph.jqtiplus.node.test.View)

Example 22 with OutcomeDeclaration

use of uk.ac.ed.ph.jqtiplus.node.outcome.declaration.OutcomeDeclaration in project openolat by klemens.

the class AssessmentItemFactory method createOutcomeDeclarationForMinScore.

public static OutcomeDeclaration createOutcomeDeclarationForMinScore(AssessmentItem assessmentItem, double minScore) {
    OutcomeDeclaration maxScoreOutcomeDeclaration = new OutcomeDeclaration(assessmentItem);
    maxScoreOutcomeDeclaration.setIdentifier(QTI21Constants.MINSCORE_IDENTIFIER);
    maxScoreOutcomeDeclaration.setCardinality(Cardinality.SINGLE);
    maxScoreOutcomeDeclaration.setBaseType(BaseType.FLOAT);
    List<View> views = new ArrayList<>();
    views.add(View.TEST_CONSTRUCTOR);
    maxScoreOutcomeDeclaration.setViews(views);
    DefaultValue maxScoreDefaultVal = new DefaultValue(maxScoreOutcomeDeclaration);
    maxScoreOutcomeDeclaration.setDefaultValue(maxScoreDefaultVal);
    FieldValue maxScoreDefaultFieldVal = new FieldValue(maxScoreDefaultVal, new FloatValue(minScore));
    maxScoreDefaultVal.getFieldValues().add(maxScoreDefaultFieldVal);
    return maxScoreOutcomeDeclaration;
}
Also used : DefaultValue(uk.ac.ed.ph.jqtiplus.node.shared.declaration.DefaultValue) ArrayList(java.util.ArrayList) FieldValue(uk.ac.ed.ph.jqtiplus.node.shared.FieldValue) FloatValue(uk.ac.ed.ph.jqtiplus.value.FloatValue) OutcomeDeclaration(uk.ac.ed.ph.jqtiplus.node.outcome.declaration.OutcomeDeclaration) View(uk.ac.ed.ph.jqtiplus.node.test.View)

Example 23 with OutcomeDeclaration

use of uk.ac.ed.ph.jqtiplus.node.outcome.declaration.OutcomeDeclaration in project openolat by klemens.

the class AssessmentItemFactory method createOutcomeDeclarationForCorrectSolutionFeedbackModal.

public static OutcomeDeclaration createOutcomeDeclarationForCorrectSolutionFeedbackModal(AssessmentItem assessmentItem) {
    OutcomeDeclaration feedbackOutcomeDeclaration = new OutcomeDeclaration(assessmentItem);
    feedbackOutcomeDeclaration.setIdentifier(QTI21Constants.CORRECT_SOLUTION_IDENTIFIER);
    feedbackOutcomeDeclaration.setCardinality(Cardinality.SINGLE);
    feedbackOutcomeDeclaration.setBaseType(BaseType.IDENTIFIER);
    List<View> views = new ArrayList<>();
    views.add(View.TEST_CONSTRUCTOR);
    feedbackOutcomeDeclaration.setViews(views);
    return feedbackOutcomeDeclaration;
}
Also used : ArrayList(java.util.ArrayList) OutcomeDeclaration(uk.ac.ed.ph.jqtiplus.node.outcome.declaration.OutcomeDeclaration) View(uk.ac.ed.ph.jqtiplus.node.test.View)

Example 24 with OutcomeDeclaration

use of uk.ac.ed.ph.jqtiplus.node.outcome.declaration.OutcomeDeclaration in project openolat by klemens.

the class AssessmentItemFactory method createOutcomeDeclarationForFeedbackModal.

public static OutcomeDeclaration createOutcomeDeclarationForFeedbackModal(AssessmentItem assessmentItem) {
    OutcomeDeclaration feedbackOutcomeDeclaration = new OutcomeDeclaration(assessmentItem);
    feedbackOutcomeDeclaration.setIdentifier(QTI21Constants.FEEDBACKMODAL_IDENTIFIER);
    feedbackOutcomeDeclaration.setCardinality(Cardinality.MULTIPLE);
    feedbackOutcomeDeclaration.setBaseType(BaseType.IDENTIFIER);
    List<View> views = new ArrayList<>();
    views.add(View.TEST_CONSTRUCTOR);
    feedbackOutcomeDeclaration.setViews(views);
    return feedbackOutcomeDeclaration;
}
Also used : ArrayList(java.util.ArrayList) OutcomeDeclaration(uk.ac.ed.ph.jqtiplus.node.outcome.declaration.OutcomeDeclaration) View(uk.ac.ed.ph.jqtiplus.node.test.View)

Example 25 with OutcomeDeclaration

use of uk.ac.ed.ph.jqtiplus.node.outcome.declaration.OutcomeDeclaration in project openolat by klemens.

the class AssessmentItemFactory method ensureFeedbackBasicOutcomeDeclaration.

public static void ensureFeedbackBasicOutcomeDeclaration(AssessmentItem assessmentItem) {
    OutcomeDeclaration feedbackBasicDeclaration = assessmentItem.getOutcomeDeclaration(QTI21Constants.FEEDBACKBASIC_IDENTIFIER);
    if (feedbackBasicDeclaration == null) {
        feedbackBasicDeclaration = createOutcomeDeclarationForFeedbackBasic(assessmentItem);
        assessmentItem.getOutcomeDeclarations().add(feedbackBasicDeclaration);
    }
}
Also used : OutcomeDeclaration(uk.ac.ed.ph.jqtiplus.node.outcome.declaration.OutcomeDeclaration)

Aggregations

OutcomeDeclaration (uk.ac.ed.ph.jqtiplus.node.outcome.declaration.OutcomeDeclaration)52 DefaultValue (uk.ac.ed.ph.jqtiplus.node.shared.declaration.DefaultValue)18 FloatValue (uk.ac.ed.ph.jqtiplus.value.FloatValue)16 FieldValue (uk.ac.ed.ph.jqtiplus.node.shared.FieldValue)14 ArrayList (java.util.ArrayList)12 BaseValue (uk.ac.ed.ph.jqtiplus.node.expression.general.BaseValue)10 View (uk.ac.ed.ph.jqtiplus.node.test.View)10 SetOutcomeValue (uk.ac.ed.ph.jqtiplus.node.item.response.processing.SetOutcomeValue)8 IdentifierValue (uk.ac.ed.ph.jqtiplus.value.IdentifierValue)8 Value (uk.ac.ed.ph.jqtiplus.value.Value)8 ModalFeedback (uk.ac.ed.ph.jqtiplus.node.item.ModalFeedback)6 Variable (uk.ac.ed.ph.jqtiplus.node.expression.general.Variable)4 Sum (uk.ac.ed.ph.jqtiplus.node.expression.operator.Sum)4 ResponseDeclaration (uk.ac.ed.ph.jqtiplus.node.item.response.declaration.ResponseDeclaration)4 ResponseCondition (uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseCondition)4 ResponseIf (uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseIf)4 ResponseRule (uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseRule)4 TemplateDeclaration (uk.ac.ed.ph.jqtiplus.node.item.template.declaration.TemplateDeclaration)4 SetOutcomeValue (uk.ac.ed.ph.jqtiplus.node.test.outcome.processing.SetOutcomeValue)4 Identifier (uk.ac.ed.ph.jqtiplus.types.Identifier)4