use of uk.ac.ed.ph.jqtiplus.node.expression.outcome.TestVariables in project OpenOLAT by OpenOLAT.
the class AssessmentTestBuilder method buildTestScore.
/* Overall score of this test
<setOutcomeValue identifier="SCORE">
<sum>
<testVariables variableIdentifier="SCORE" />
</sum>
</setOutcomeValue>
*/
private void buildTestScore() {
if (testScoreRule == null) {
SetOutcomeValue scoreRule = new SetOutcomeValue(assessmentTest);
scoreRule.setIdentifier(QTI21Constants.SCORE_IDENTIFIER);
Sum sum = new Sum(scoreRule);
scoreRule.getExpressions().add(sum);
TestVariables testVariables = new TestVariables(sum);
sum.getExpressions().add(testVariables);
testVariables.setVariableIdentifier(QTI21Constants.SCORE_IDENTIFIER);
assessmentTest.getOutcomeProcessing().getOutcomeRules().add(0, scoreRule);
testScoreRule = scoreRule;
}
if (minScoreRule == null) {
OutcomeCondition scoreRule = AssessmentTestFactory.createMinScoreRule(assessmentTest);
assessmentTest.getOutcomeProcessing().getOutcomeRules().add(1, scoreRule);
minScoreRule = scoreRule;
}
}
Aggregations