Search in sources :

Example 1 with AssessmentTestDisplayController

use of org.olat.ims.qti21.ui.AssessmentTestDisplayController 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 AssessmentTestDisplayController

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

the class QTI21AssessmentRunController method doStart.

private void doStart(UserRequest ureq) {
    removeAsListenerAndDispose(displayCtrl);
    OLATResourceable ores = OresHelper.createOLATResourceableTypeWithoutCheck("test");
    ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
    WindowControl bwControl = addToHistory(ureq, ores, null);
    RepositoryEntry courseRe = userCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
    displayCtrl = new AssessmentTestDisplayController(ureq, bwControl, this, testEntry, courseRe, courseNode.getIdent(), deliveryOptions, overrideOptions, true, false, false);
    listenTo(displayCtrl);
    if (displayCtrl.getAssessmentTest() == null) {
        logError("Test cannot be read: " + testEntry + " in course: " + courseRe + " element: " + courseNode.getIdent(), null);
        showError("error.resource.corrupted");
    } else if (displayCtrl.isEnded()) {
        if (!displayCtrl.isResultsVisible()) {
            doExitAssessment(ureq, null, true);
            initAssessment(ureq);
        }
    } else {
        // in case displayController was unable to initialize, a message was set by displayController
        // this is the case if no more attempts or security check was unsuccessfull
        displayContainerController = new QTI21AssessmentMainLayoutController(ureq, getWindowControl(), displayCtrl);
        // autodispose
        listenTo(displayContainerController);
        // empty panel set as "menu" and "tool"
        Panel empty = new Panel("empty");
        Controller courseCloser = new DisposedCourseRestartController(ureq, getWindowControl(), courseRe);
        Controller disposedRestartController = new LayoutMain3ColsController(ureq, getWindowControl(), empty, courseCloser.getInitialComponent(), "disposed");
        displayContainerController.setDisposedMessageController(disposedRestartController);
        boolean fullWindow = deliveryOptions.isHideLms();
        if (fullWindow) {
            displayContainerController.setAsFullscreen(ureq);
        }
        displayContainerController.activate();
        assessmentStopped = false;
        singleUserEventCenter.registerFor(this, getIdentity(), assessmentInstanceOres);
        singleUserEventCenter.fireEventToListenersOf(new AssessmentEvent(AssessmentEvent.TYPE.STARTED, ureq.getUserSession()), assessmentEventOres);
        ThreadLocalUserActivityLogger.log(QTI21LoggingAction.QTI_START_IN_COURSE, getClass());
    }
}
Also used : Panel(org.olat.core.gui.components.panel.Panel) OLATResourceable(org.olat.core.id.OLATResourceable) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) AssessmentTestDisplayController(org.olat.ims.qti21.ui.AssessmentTestDisplayController) RepositoryEntry(org.olat.repository.RepositoryEntry) DisposedCourseRestartController(org.olat.course.DisposedCourseRestartController) WindowControl(org.olat.core.gui.control.WindowControl) DisposedCourseRestartController(org.olat.course.DisposedCourseRestartController) HighScoreRunController(org.olat.course.highscore.ui.HighScoreRunController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) BasicController(org.olat.core.gui.control.controller.BasicController) AssessmentResultController(org.olat.ims.qti21.ui.AssessmentResultController) IFrameDisplayController(org.olat.core.gui.control.generic.iframe.IFrameDisplayController) Controller(org.olat.core.gui.control.Controller) AssessmentTestDisplayController(org.olat.ims.qti21.ui.AssessmentTestDisplayController)

Example 3 with AssessmentTestDisplayController

use of org.olat.ims.qti21.ui.AssessmentTestDisplayController 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)

Example 4 with AssessmentTestDisplayController

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

the class QTI21AssessmentRunController method doStart.

private void doStart(UserRequest ureq) {
    removeAsListenerAndDispose(displayCtrl);
    OLATResourceable ores = OresHelper.createOLATResourceableTypeWithoutCheck("test");
    ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
    WindowControl bwControl = addToHistory(ureq, ores, null);
    RepositoryEntry courseRe = userCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
    displayCtrl = new AssessmentTestDisplayController(ureq, bwControl, this, testEntry, courseRe, courseNode.getIdent(), deliveryOptions, overrideOptions, true, false, false);
    listenTo(displayCtrl);
    if (displayCtrl.getAssessmentTest() == null) {
        logError("Test cannot be read: " + testEntry + " in course: " + courseRe + " element: " + courseNode.getIdent(), null);
        showError("error.resource.corrupted");
    } else if (displayCtrl.isEnded()) {
        if (!displayCtrl.isResultsVisible()) {
            doExitAssessment(ureq, null, true);
            initAssessment(ureq);
        }
    } else {
        // in case displayController was unable to initialize, a message was set by displayController
        // this is the case if no more attempts or security check was unsuccessfull
        displayContainerController = new QTI21AssessmentMainLayoutController(ureq, getWindowControl(), displayCtrl);
        // autodispose
        listenTo(displayContainerController);
        // empty panel set as "menu" and "tool"
        Panel empty = new Panel("empty");
        Controller courseCloser = new DisposedCourseRestartController(ureq, getWindowControl(), courseRe);
        Controller disposedRestartController = new LayoutMain3ColsController(ureq, getWindowControl(), empty, courseCloser.getInitialComponent(), "disposed");
        displayContainerController.setDisposedMessageController(disposedRestartController);
        boolean fullWindow = deliveryOptions.isHideLms();
        if (fullWindow) {
            displayContainerController.setAsFullscreen(ureq);
        }
        displayContainerController.activate();
        assessmentStopped = false;
        singleUserEventCenter.registerFor(this, getIdentity(), assessmentInstanceOres);
        singleUserEventCenter.fireEventToListenersOf(new AssessmentEvent(AssessmentEvent.TYPE.STARTED, ureq.getUserSession()), assessmentEventOres);
        ThreadLocalUserActivityLogger.log(QTI21LoggingAction.QTI_START_IN_COURSE, getClass());
    }
}
Also used : Panel(org.olat.core.gui.components.panel.Panel) OLATResourceable(org.olat.core.id.OLATResourceable) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) AssessmentTestDisplayController(org.olat.ims.qti21.ui.AssessmentTestDisplayController) RepositoryEntry(org.olat.repository.RepositoryEntry) DisposedCourseRestartController(org.olat.course.DisposedCourseRestartController) WindowControl(org.olat.core.gui.control.WindowControl) DisposedCourseRestartController(org.olat.course.DisposedCourseRestartController) HighScoreRunController(org.olat.course.highscore.ui.HighScoreRunController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) BasicController(org.olat.core.gui.control.controller.BasicController) AssessmentResultController(org.olat.ims.qti21.ui.AssessmentResultController) IFrameDisplayController(org.olat.core.gui.control.generic.iframe.IFrameDisplayController) Controller(org.olat.core.gui.control.Controller) AssessmentTestDisplayController(org.olat.ims.qti21.ui.AssessmentTestDisplayController)

Aggregations

LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)4 Controller (org.olat.core.gui.control.Controller)4 BasicController (org.olat.core.gui.control.controller.BasicController)4 AssessmentTestDisplayController (org.olat.ims.qti21.ui.AssessmentTestDisplayController)4 RepositoryEntry (org.olat.repository.RepositoryEntry)4 Panel (org.olat.core.gui.components.panel.Panel)2 WindowControl (org.olat.core.gui.control.WindowControl)2 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)2 IFrameDisplayController (org.olat.core.gui.control.generic.iframe.IFrameDisplayController)2 OLATResourceable (org.olat.core.id.OLATResourceable)2 DisposedCourseRestartController (org.olat.course.DisposedCourseRestartController)2 NodeEditController (org.olat.course.editor.NodeEditController)2 HighScoreRunController (org.olat.course.highscore.ui.HighScoreRunController)2 QTI21DeliveryOptions (org.olat.ims.qti21.QTI21DeliveryOptions)2 InMemoryOutcomeListener (org.olat.ims.qti21.model.InMemoryOutcomeListener)2 AssessmentResultController (org.olat.ims.qti21.ui.AssessmentResultController)2 QTI21OverrideOptions (org.olat.ims.qti21.ui.QTI21OverrideOptions)2 IQPreviewSecurityCallback (org.olat.modules.iq.IQPreviewSecurityCallback)2 ReferencableEntriesSearchController (org.olat.repository.controllers.ReferencableEntriesSearchController)2