Search in sources :

Example 16 with MapResponse

use of uk.ac.ed.ph.jqtiplus.node.expression.general.MapResponse in project openolat by klemens.

the class AssessmentItemFactory method appendSetOutcomeScoreMapResponse.

/*
    <setOutcomeValue identifier="SCORE">
      <sum>
        <variable identifier="SCORE"/>
        <mapResponse identifier="RESPONSE_1"/>
      </sum>
    </setOutcomeValue>
	*/
public static void appendSetOutcomeScoreMapResponse(ResponseConditionChild responseCondition, Identifier responseIdentifier) {
    SetOutcomeValue scoreOutcome = new SetOutcomeValue(responseCondition);
    scoreOutcome.setIdentifier(QTI21Constants.SCORE_IDENTIFIER);
    responseCondition.getResponseRules().add(scoreOutcome);
    Sum sum = new Sum(scoreOutcome);
    scoreOutcome.getExpressions().add(sum);
    Variable scoreVar = new Variable(sum);
    scoreVar.setIdentifier(QTI21Constants.SCORE_CLX_IDENTIFIER);
    sum.getExpressions().add(scoreVar);
    MapResponse mapResponse = new MapResponse(sum);
    mapResponse.setIdentifier(responseIdentifier);
    sum.getExpressions().add(mapResponse);
}
Also used : MapResponse(uk.ac.ed.ph.jqtiplus.node.expression.general.MapResponse) Variable(uk.ac.ed.ph.jqtiplus.node.expression.general.Variable) SetOutcomeValue(uk.ac.ed.ph.jqtiplus.node.item.response.processing.SetOutcomeValue) Sum(uk.ac.ed.ph.jqtiplus.node.expression.operator.Sum)

Aggregations

MapResponse (uk.ac.ed.ph.jqtiplus.node.expression.general.MapResponse)16 Variable (uk.ac.ed.ph.jqtiplus.node.expression.general.Variable)16 Sum (uk.ac.ed.ph.jqtiplus.node.expression.operator.Sum)16 SetOutcomeValue (uk.ac.ed.ph.jqtiplus.node.item.response.processing.SetOutcomeValue)16 BaseValue (uk.ac.ed.ph.jqtiplus.node.expression.general.BaseValue)14 ResponseIf (uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseIf)14 Correct (uk.ac.ed.ph.jqtiplus.node.expression.general.Correct)10 ResponseElse (uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseElse)10 ComplexReferenceIdentifier (uk.ac.ed.ph.jqtiplus.types.ComplexReferenceIdentifier)10 Match (uk.ac.ed.ph.jqtiplus.node.expression.operator.Match)8 ArrayList (java.util.ArrayList)4 Equal (uk.ac.ed.ph.jqtiplus.node.expression.operator.Equal)4 IsNull (uk.ac.ed.ph.jqtiplus.node.expression.operator.IsNull)4 MapEntry (uk.ac.ed.ph.jqtiplus.node.item.response.declaration.MapEntry)4 ResponseCondition (uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseCondition)4 FloatOrVariableRef (uk.ac.ed.ph.jqtiplus.types.FloatOrVariableRef)4 FloatValue (uk.ac.ed.ph.jqtiplus.value.FloatValue)4 HashMap (java.util.HashMap)2 List (java.util.List)2 Map (java.util.Map)2