use of uk.ac.ed.ph.jqtiplus.node.test.TimeLimits in project OpenOLAT by OpenOLAT.
the class QTI12To21Converter method convertDuration.
private void convertDuration(Duration duration, ControlObject<?> parent) {
if (duration != null && duration.isSet()) {
TimeLimits timeLimits = new TimeLimits(parent);
double timeInSeconds = (60 * duration.getMin()) + duration.getSec();
timeLimits.setMaximum(timeInSeconds);
parent.setTimeLimits(timeLimits);
}
}
use of uk.ac.ed.ph.jqtiplus.node.test.TimeLimits in project openolat by klemens.
the class QTI12To21Converter method convertItemBasics.
private void convertItemBasics(Item item, AssessmentItemRef itemRef) {
if (item.getMaxattempts() > 0) {
ItemSessionControl itemSessionControl = itemRef.getItemSessionControl();
if (itemSessionControl == null) {
itemSessionControl = new ItemSessionControl(itemRef);
itemRef.setItemSessionControl(itemSessionControl);
}
itemSessionControl.setMaxAttempts(item.getMaxattempts());
}
if (item.getDuration() != null && item.getDuration().isSet()) {
TimeLimits timeLimits = itemRef.getTimeLimits();
if (timeLimits == null) {
timeLimits = new TimeLimits(itemRef);
itemRef.setTimeLimits(timeLimits);
}
timeLimits.setMinimum(0.0d);
double max = 0.0d;
if (item.getDuration().getMin() > 0) {
max += item.getDuration().getMin() * 60d;
}
if (item.getDuration().getSec() > 0) {
max += item.getDuration().getSec();
}
timeLimits.setMaximum(max);
}
}
use of uk.ac.ed.ph.jqtiplus.node.test.TimeLimits 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