Search in sources :

Example 1 with QTI21OverrideOptions

use of org.olat.ims.qti21.ui.QTI21OverrideOptions in project openolat by klemens.

the class IQConfigurationController method doPreview.

private void doPreview(UserRequest ureq) {
    removeAsListenerAndDispose(previewLayoutCtr);
    RepositoryEntry re = getIQReference();
    if (re != null) {
        Controller previewController;
        if (OnyxModule.isOnyxTest(re.getOlatResource())) {
            showError("error.onyx");
        } else if (ImsQTI21Resource.TYPE_NAME.equals(re.getOlatResource().getResourceableTypeName())) {
            // clean up last session
            cleanUpQti21PreviewSession();
            // need to clean up the assessment test session
            QTI21DeliveryOptions deliveryOptions = qti21service.getDeliveryOptions(re);
            QTI21OverrideOptions overrideOptions = QTI21OverrideOptions.nothingOverriden();
            RepositoryEntry courseEntry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
            previewQTI21Ctrl = new AssessmentTestDisplayController(ureq, getWindowControl(), new InMemoryOutcomeListener(), re, courseEntry, courseNode.getIdent(), deliveryOptions, overrideOptions, true, true, true);
            listenTo(previewQTI21Ctrl);
            stackPanel.pushController(translate("preview"), previewQTI21Ctrl);
        } else {
            long courseResId = course.getResourceableId().longValue();
            previewController = iqManager.createIQDisplayController(moduleConfiguration, new IQPreviewSecurityCallback(), ureq, getWindowControl(), courseResId, courseNode.getIdent(), null);
            previewLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), previewController);
            stackPanel.pushController(translate("preview"), previewLayoutCtr);
        }
    }
}
Also used : QTI21DeliveryOptions(org.olat.ims.qti21.QTI21DeliveryOptions) InMemoryOutcomeListener(org.olat.ims.qti21.model.InMemoryOutcomeListener) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) QTI21OverrideOptions(org.olat.ims.qti21.ui.QTI21OverrideOptions) AssessmentTestDisplayController(org.olat.ims.qti21.ui.AssessmentTestDisplayController) RepositoryEntry(org.olat.repository.RepositoryEntry) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) ReferencableEntriesSearchController(org.olat.repository.controllers.ReferencableEntriesSearchController) NodeEditController(org.olat.course.editor.NodeEditController) BasicController(org.olat.core.gui.control.controller.BasicController) Controller(org.olat.core.gui.control.Controller) AssessmentTestDisplayController(org.olat.ims.qti21.ui.AssessmentTestDisplayController) IQPreviewSecurityCallback(org.olat.modules.iq.IQPreviewSecurityCallback)

Example 2 with QTI21OverrideOptions

use of org.olat.ims.qti21.ui.QTI21OverrideOptions in project openolat by klemens.

the class QTI21AssessmentRunController method getOverrideOptions.

private QTI21OverrideOptions getOverrideOptions() {
    boolean configRef = config.getBooleanSafe(IQEditController.CONFIG_KEY_CONFIG_REF, false);
    Long maxTimeLimit = null;
    if (!configRef) {
        int timeLimit = config.getIntegerSafe(IQEditController.CONFIG_KEY_TIME_LIMIT, -1);
        if (timeLimit > 0) {
            maxTimeLimit = new Long(timeLimit);
        }
    }
    Date startTestDate = null;
    Date endTestDate = null;
    boolean dependOnDate = config.getBooleanSafe(IQEditController.CONFIG_KEY_DATE_DEPENDENT_TEST, false);
    if (dependOnDate) {
        startTestDate = config.getDateValue(IQEditController.CONFIG_KEY_RESULTS_START_TEST_DATE);
        if (startTestDate != null) {
            endTestDate = config.getDateValue(IQEditController.CONFIG_KEY_RESULTS_END_TEST_DATE);
        }
    }
    return new QTI21OverrideOptions(maxTimeLimit, startTestDate, endTestDate);
}
Also used : QTI21OverrideOptions(org.olat.ims.qti21.ui.QTI21OverrideOptions) Date(java.util.Date)

Example 3 with QTI21OverrideOptions

use of org.olat.ims.qti21.ui.QTI21OverrideOptions in project OpenOLAT by OpenOLAT.

the class QTI21AssessmentRunController method getOverrideOptions.

private QTI21OverrideOptions getOverrideOptions() {
    boolean configRef = config.getBooleanSafe(IQEditController.CONFIG_KEY_CONFIG_REF, false);
    Long maxTimeLimit = null;
    if (!configRef) {
        int timeLimit = config.getIntegerSafe(IQEditController.CONFIG_KEY_TIME_LIMIT, -1);
        if (timeLimit > 0) {
            maxTimeLimit = new Long(timeLimit);
        }
    }
    Date startTestDate = null;
    Date endTestDate = null;
    boolean dependOnDate = config.getBooleanSafe(IQEditController.CONFIG_KEY_DATE_DEPENDENT_TEST, false);
    if (dependOnDate) {
        startTestDate = config.getDateValue(IQEditController.CONFIG_KEY_RESULTS_START_TEST_DATE);
        if (startTestDate != null) {
            endTestDate = config.getDateValue(IQEditController.CONFIG_KEY_RESULTS_END_TEST_DATE);
        }
    }
    return new QTI21OverrideOptions(maxTimeLimit, startTestDate, endTestDate);
}
Also used : QTI21OverrideOptions(org.olat.ims.qti21.ui.QTI21OverrideOptions) Date(java.util.Date)

Example 4 with QTI21OverrideOptions

use of org.olat.ims.qti21.ui.QTI21OverrideOptions in project OpenOLAT by OpenOLAT.

the class IQConfigurationController method doPreview.

private void doPreview(UserRequest ureq) {
    removeAsListenerAndDispose(previewLayoutCtr);
    RepositoryEntry re = getIQReference();
    if (re != null) {
        Controller previewController;
        if (OnyxModule.isOnyxTest(re.getOlatResource())) {
            showError("error.onyx");
        } else if (ImsQTI21Resource.TYPE_NAME.equals(re.getOlatResource().getResourceableTypeName())) {
            // clean up last session
            cleanUpQti21PreviewSession();
            // need to clean up the assessment test session
            QTI21DeliveryOptions deliveryOptions = qti21service.getDeliveryOptions(re);
            QTI21OverrideOptions overrideOptions = QTI21OverrideOptions.nothingOverriden();
            RepositoryEntry courseEntry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
            previewQTI21Ctrl = new AssessmentTestDisplayController(ureq, getWindowControl(), new InMemoryOutcomeListener(), re, courseEntry, courseNode.getIdent(), deliveryOptions, overrideOptions, true, true, true);
            listenTo(previewQTI21Ctrl);
            stackPanel.pushController(translate("preview"), previewQTI21Ctrl);
        } else {
            long courseResId = course.getResourceableId().longValue();
            previewController = iqManager.createIQDisplayController(moduleConfiguration, new IQPreviewSecurityCallback(), ureq, getWindowControl(), courseResId, courseNode.getIdent(), null);
            previewLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), previewController);
            stackPanel.pushController(translate("preview"), previewLayoutCtr);
        }
    }
}
Also used : QTI21DeliveryOptions(org.olat.ims.qti21.QTI21DeliveryOptions) InMemoryOutcomeListener(org.olat.ims.qti21.model.InMemoryOutcomeListener) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) QTI21OverrideOptions(org.olat.ims.qti21.ui.QTI21OverrideOptions) AssessmentTestDisplayController(org.olat.ims.qti21.ui.AssessmentTestDisplayController) RepositoryEntry(org.olat.repository.RepositoryEntry) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) ReferencableEntriesSearchController(org.olat.repository.controllers.ReferencableEntriesSearchController) NodeEditController(org.olat.course.editor.NodeEditController) BasicController(org.olat.core.gui.control.controller.BasicController) Controller(org.olat.core.gui.control.Controller) AssessmentTestDisplayController(org.olat.ims.qti21.ui.AssessmentTestDisplayController) IQPreviewSecurityCallback(org.olat.modules.iq.IQPreviewSecurityCallback)

Aggregations

QTI21OverrideOptions (org.olat.ims.qti21.ui.QTI21OverrideOptions)4 Date (java.util.Date)2 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)2 Controller (org.olat.core.gui.control.Controller)2 BasicController (org.olat.core.gui.control.controller.BasicController)2 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)2 NodeEditController (org.olat.course.editor.NodeEditController)2 QTI21DeliveryOptions (org.olat.ims.qti21.QTI21DeliveryOptions)2 InMemoryOutcomeListener (org.olat.ims.qti21.model.InMemoryOutcomeListener)2 AssessmentTestDisplayController (org.olat.ims.qti21.ui.AssessmentTestDisplayController)2 IQPreviewSecurityCallback (org.olat.modules.iq.IQPreviewSecurityCallback)2 RepositoryEntry (org.olat.repository.RepositoryEntry)2 ReferencableEntriesSearchController (org.olat.repository.controllers.ReferencableEntriesSearchController)2