use of uk.ac.ed.ph.jqtiplus.node.test.outcome.processing.OutcomeProcessing in project OpenOLAT by OpenOLAT.
the class AssessmentTestBuilder method build.
public AssessmentTest build() {
if (!editable) {
return assessmentTest;
}
if (assessmentTest.getOutcomeProcessing() == null) {
assessmentTest.setOutcomeProcessing(new OutcomeProcessing(assessmentTest));
}
if (maximumTimeLimits != null) {
TimeLimits timeLimits = new TimeLimits(assessmentTest);
timeLimits.setMaximum(maximumTimeLimits.doubleValue());
assessmentTest.setTimeLimits(timeLimits);
} else {
assessmentTest.setTimeLimits(null);
}
buildScore();
buildTestScore();
buildCutValue();
buildFeedback();
// clean up
if (assessmentTest.getOutcomeProcessing().getOutcomeRules().isEmpty()) {
assessmentTest.setOutcomeProcessing(null);
}
return assessmentTest;
}
use of uk.ac.ed.ph.jqtiplus.node.test.outcome.processing.OutcomeProcessing in project OpenOLAT by OpenOLAT.
the class AssessmentTestFactory method createAssessmentTest.
/**
* Create an assessmentTest object but without items
*
* @param title
* @return
*/
public static AssessmentTest createAssessmentTest(String title, String sectionTitle) {
AssessmentTest assessmentTest = new AssessmentTest();
assessmentTest.setIdentifier(IdentifierGenerator.newAsString("test"));
assessmentTest.setTitle(title);
assessmentTest.setToolName(QTI21Constants.TOOLNAME);
assessmentTest.setToolVersion(Settings.getVersion());
// outcome score
OutcomeDeclaration scoreOutcomeDeclaration = new OutcomeDeclaration(assessmentTest);
scoreOutcomeDeclaration.setIdentifier(QTI21Constants.SCORE_IDENTIFIER);
scoreOutcomeDeclaration.setCardinality(Cardinality.SINGLE);
scoreOutcomeDeclaration.setBaseType(BaseType.FLOAT);
assessmentTest.getOutcomeDeclarations().add(scoreOutcomeDeclaration);
// test part
TestPart part = createTestPart(assessmentTest);
appendAssessmentSection(sectionTitle, part);
// outcome processing
OutcomeProcessing outcomeProcessing = new OutcomeProcessing(assessmentTest);
assessmentTest.setOutcomeProcessing(outcomeProcessing);
SetOutcomeValue outcomeRule = new SetOutcomeValue(outcomeProcessing);
outcomeRule.setIdentifier(QTI21Constants.SCORE_IDENTIFIER);
Sum sum = new Sum(outcomeRule);
outcomeRule.getExpressions().add(sum);
TestVariables testVariables = new TestVariables(sum);
testVariables.setVariableIdentifier(QTI21Constants.SCORE_IDENTIFIER);
sum.getExpressions().add(testVariables);
outcomeProcessing.getOutcomeRules().add(outcomeRule);
return assessmentTest;
}
use of uk.ac.ed.ph.jqtiplus.node.test.outcome.processing.OutcomeProcessing in project openolat by klemens.
the class AssessmentTestFactory method createAssessmentTest.
/**
* Create an assessmentTest object but without items
*
* @param title
* @return
*/
public static AssessmentTest createAssessmentTest(String title, String sectionTitle) {
AssessmentTest assessmentTest = new AssessmentTest();
assessmentTest.setIdentifier(IdentifierGenerator.newAsString("test"));
assessmentTest.setTitle(title);
assessmentTest.setToolName(QTI21Constants.TOOLNAME);
assessmentTest.setToolVersion(Settings.getVersion());
// outcome score
OutcomeDeclaration scoreOutcomeDeclaration = new OutcomeDeclaration(assessmentTest);
scoreOutcomeDeclaration.setIdentifier(QTI21Constants.SCORE_IDENTIFIER);
scoreOutcomeDeclaration.setCardinality(Cardinality.SINGLE);
scoreOutcomeDeclaration.setBaseType(BaseType.FLOAT);
assessmentTest.getOutcomeDeclarations().add(scoreOutcomeDeclaration);
// test part
TestPart part = createTestPart(assessmentTest);
appendAssessmentSection(sectionTitle, part);
// outcome processing
OutcomeProcessing outcomeProcessing = new OutcomeProcessing(assessmentTest);
assessmentTest.setOutcomeProcessing(outcomeProcessing);
SetOutcomeValue outcomeRule = new SetOutcomeValue(outcomeProcessing);
outcomeRule.setIdentifier(QTI21Constants.SCORE_IDENTIFIER);
Sum sum = new Sum(outcomeRule);
outcomeRule.getExpressions().add(sum);
TestVariables testVariables = new TestVariables(sum);
testVariables.setVariableIdentifier(QTI21Constants.SCORE_IDENTIFIER);
sum.getExpressions().add(testVariables);
outcomeProcessing.getOutcomeRules().add(outcomeRule);
return assessmentTest;
}
use of uk.ac.ed.ph.jqtiplus.node.test.outcome.processing.OutcomeProcessing in project openolat by klemens.
the class AssessmentTestBuilder method build.
public AssessmentTest build() {
if (!editable) {
return assessmentTest;
}
if (assessmentTest.getOutcomeProcessing() == null) {
assessmentTest.setOutcomeProcessing(new OutcomeProcessing(assessmentTest));
}
if (maximumTimeLimits != null) {
TimeLimits timeLimits = new TimeLimits(assessmentTest);
timeLimits.setMaximum(maximumTimeLimits.doubleValue());
assessmentTest.setTimeLimits(timeLimits);
} else {
assessmentTest.setTimeLimits(null);
}
buildScore();
buildTestScore();
buildCutValue();
buildFeedback();
// clean up
if (assessmentTest.getOutcomeProcessing().getOutcomeRules().isEmpty()) {
assessmentTest.setOutcomeProcessing(null);
}
return assessmentTest;
}
Aggregations