Search in sources :

Example 6 with TimeLimits

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);
    }
}
Also used : TimeLimits(uk.ac.ed.ph.jqtiplus.node.test.TimeLimits)

Example 7 with 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);
    }
}
Also used : ItemSessionControl(uk.ac.ed.ph.jqtiplus.node.test.ItemSessionControl) TimeLimits(uk.ac.ed.ph.jqtiplus.node.test.TimeLimits)

Example 8 with TimeLimits

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;
}
Also used : OutcomeProcessing(uk.ac.ed.ph.jqtiplus.node.test.outcome.processing.OutcomeProcessing) TimeLimits(uk.ac.ed.ph.jqtiplus.node.test.TimeLimits)

Aggregations

TimeLimits (uk.ac.ed.ph.jqtiplus.node.test.TimeLimits)8 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)2 FormSubmit (org.olat.core.gui.components.form.flexible.impl.elements.FormSubmit)2 ItemSessionControl (uk.ac.ed.ph.jqtiplus.node.test.ItemSessionControl)2 OutcomeProcessing (uk.ac.ed.ph.jqtiplus.node.test.outcome.processing.OutcomeProcessing)2