Search in sources :

Example 16 with NodeRunConstructionResult

use of org.olat.course.run.navigation.NodeRunConstructionResult in project OpenOLAT by OpenOLAT.

the class CalCourseNode method createNodeRunConstructionResult.

/**
 * @see org.olat.course.nodes.CourseNode#createNodeRunConstructionResult(org.olat.core.gui.UserRequest,
 *      org.olat.core.gui.control.WindowControl,
 *      org.olat.course.run.userview.UserCourseEnvironment,
 *      org.olat.course.run.userview.NodeEvaluation)
 */
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    updateModuleConfigDefaults(false);
    CalRunController calCtlr = new CalRunController(wControl, ureq, this, userCourseEnv, ne);
    Controller wrapperCtrl = TitledWrapperHelper.getWrapper(ureq, wControl, calCtlr, this, "o_cal_icon");
    return new NodeRunConstructionResult(wrapperCtrl);
}
Also used : CalRunController(org.olat.course.nodes.cal.CalRunController) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) CalRunController(org.olat.course.nodes.cal.CalRunController) CourseCalendarPeekViewController(org.olat.course.nodes.cal.CourseCalendarPeekViewController) CalEditController(org.olat.course.nodes.cal.CalEditController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult)

Example 17 with NodeRunConstructionResult

use of org.olat.course.run.navigation.NodeRunConstructionResult in project OpenOLAT by OpenOLAT.

the class Card2BrainCourseNode method createNodeRunConstructionResult.

@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    updateModuleConfigDefaults(false);
    Controller runCtrl;
    if (userCourseEnv.isCourseReadOnly()) {
        Translator trans = Util.createPackageTranslator(Card2BrainCourseNode.class, ureq.getLocale());
        String title = trans.translate("freezenoaccess.title");
        String message = trans.translate("freezenoaccess.message");
        runCtrl = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
    } else if (userCourseEnv.getIdentityEnvironment().getRoles().isGuestOnly()) {
        Translator trans = Util.createPackageTranslator(Card2BrainCourseNode.class, ureq.getLocale());
        String title = trans.translate("guestnoaccess.title");
        String message = trans.translate("guestnoaccess.message");
        runCtrl = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
    } else {
        runCtrl = new Card2BrainRunController(ureq, wControl, this.getModuleConfiguration());
    }
    Controller ctrl = TitledWrapperHelper.getWrapper(ureq, wControl, runCtrl, this, "o_card2brain_icon");
    return new NodeRunConstructionResult(ctrl);
}
Also used : Card2BrainRunController(org.olat.course.nodes.card2brain.Card2BrainRunController) Translator(org.olat.core.gui.translator.Translator) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) Card2BrainPeekViewController(org.olat.course.nodes.card2brain.Card2BrainPeekViewController) Card2BrainRunController(org.olat.course.nodes.card2brain.Card2BrainRunController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) Card2BrainEditController(org.olat.course.nodes.card2brain.Card2BrainEditController) ConditionEditController(org.olat.course.condition.ConditionEditController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult)

Example 18 with NodeRunConstructionResult

use of org.olat.course.run.navigation.NodeRunConstructionResult in project OpenOLAT by OpenOLAT.

the class CPRunController method createNodeRunConstructionResult.

public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, String selectedNodeId) {
    NodeRunConstructionResult ncr;
    if (isExternalMenuConfigured()) {
        // integrate it into the olat menu
        Controller ctrl = TitledWrapperHelper.getWrapper(ureq, getWindowControl(), this, cpNode, "o_cp_icon");
        if (StringHelper.containsNonWhitespace(selectedNodeId) && treeModel.getNodeById(selectedNodeId) != null) {
            selNodeId = selectedNodeId;
        }
        ncr = new NodeRunConstructionResult(ctrl, treeModel, selNodeId, treeNodeClickListener);
    } else {
        // no menu to integrate
        Controller ctrl = TitledWrapperHelper.getWrapper(ureq, getWindowControl(), this, cpNode, "o_cp_icon");
        ncr = new NodeRunConstructionResult(ctrl);
    }
    return ncr;
}
Also used : NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult) CPDisplayController(org.olat.modules.cp.CPDisplayController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) BasicController(org.olat.core.gui.control.controller.BasicController)

Example 19 with NodeRunConstructionResult

use of org.olat.course.run.navigation.NodeRunConstructionResult in project OpenOLAT by OpenOLAT.

the class IQSELFCourseNode method createNodeRunConstructionResult.

/**
 * @see org.olat.course.nodes.CourseNode#createNodeRunConstructionResult(org.olat.core.gui.UserRequest,
 *      org.olat.core.gui.control.WindowControl,
 *      org.olat.course.run.userview.UserCourseEnvironment,
 *      org.olat.course.run.userview.NodeEvaluation)
 */
@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    Controller runController;
    ModuleConfiguration config = getModuleConfiguration();
    AssessmentManager am = userCourseEnv.getCourseEnvironment().getAssessmentManager();
    boolean onyx = IQEditController.CONFIG_VALUE_QTI2.equals(config.get(IQEditController.CONFIG_KEY_TYPE_QTI));
    if (onyx) {
        Translator trans = Util.createPackageTranslator(IQEditController.class, ureq.getLocale());
        runController = MessageUIFactory.createInfoMessage(ureq, wControl, "", trans.translate("error.onyx"));
    } else {
        RepositoryEntry testEntry = getReferencedRepositoryEntry();
        if (ImsQTI21Resource.TYPE_NAME.equals(testEntry.getOlatResource().getResourceableTypeName())) {
            runController = new QTI21AssessmentRunController(ureq, wControl, userCourseEnv, this);
        } else {
            IQSecurityCallback sec = new CourseIQSecurityCallback(this, am, ureq.getIdentity());
            runController = new IQRunController(userCourseEnv, getModuleConfiguration(), sec, ureq, wControl, this);
        }
    }
    Controller ctrl = TitledWrapperHelper.getWrapper(ureq, wControl, runController, this, "o_iqself_icon");
    return new NodeRunConstructionResult(ctrl);
}
Also used : QTI21AssessmentRunController(org.olat.course.nodes.iq.QTI21AssessmentRunController) ModuleConfiguration(org.olat.modules.ModuleConfiguration) CourseIQSecurityCallback(org.olat.course.nodes.iq.CourseIQSecurityCallback) IQRunController(org.olat.course.nodes.iq.IQRunController) Translator(org.olat.core.gui.translator.Translator) PackageTranslator(org.olat.core.gui.translator.PackageTranslator) AssessmentManager(org.olat.course.assessment.AssessmentManager) IQSecurityCallback(org.olat.modules.iq.IQSecurityCallback) CourseIQSecurityCallback(org.olat.course.nodes.iq.CourseIQSecurityCallback) RepositoryEntry(org.olat.repository.RepositoryEntry) QTI21AssessmentRunController(org.olat.course.nodes.iq.QTI21AssessmentRunController) IQEditController(org.olat.course.nodes.iq.IQEditController) NodeEditController(org.olat.course.editor.NodeEditController) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) Controller(org.olat.core.gui.control.Controller) IQRunController(org.olat.course.nodes.iq.IQRunController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult)

Example 20 with NodeRunConstructionResult

use of org.olat.course.run.navigation.NodeRunConstructionResult in project OpenOLAT by OpenOLAT.

the class IQTESTCourseNode method createNodeRunConstructionResult.

@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    updateModuleConfigDefaults(false);
    Controller controller;
    // Do not allow guests to start tests
    Roles roles = ureq.getUserSession().getRoles();
    Translator trans = Util.createPackageTranslator(IQTESTCourseNode.class, ureq.getLocale());
    if (roles.isGuestOnly()) {
        if (isGuestAllowedForQTI21(getReferencedRepositoryEntry())) {
            controller = new QTI21AssessmentRunController(ureq, wControl, userCourseEnv, this);
        } else {
            String title = trans.translate("guestnoaccess.title");
            String message = trans.translate("guestnoaccess.message");
            controller = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
        }
    } else {
        ModuleConfiguration config = getModuleConfiguration();
        boolean onyx = IQEditController.CONFIG_VALUE_QTI2.equals(config.get(IQEditController.CONFIG_KEY_TYPE_QTI));
        if (onyx) {
            Translator transe = Util.createPackageTranslator(IQEditController.class, ureq.getLocale());
            controller = MessageUIFactory.createInfoMessage(ureq, wControl, "", transe.translate("error.onyx"));
        } else {
            RepositoryEntry testEntry = getReferencedRepositoryEntry();
            OLATResource ores = testEntry.getOlatResource();
            if (ImsQTI21Resource.TYPE_NAME.equals(ores.getResourceableTypeName())) {
                // QTI 2.1
                controller = new QTI21AssessmentRunController(ureq, wControl, userCourseEnv, this);
            } else {
                // QTI 1.2
                TestFileResource fr = new TestFileResource();
                fr.overrideResourceableId(ores.getResourceableId());
                if (!CoordinatorManager.getInstance().getCoordinator().getLocker().isLocked(fr, null)) {
                    AssessmentManager am = userCourseEnv.getCourseEnvironment().getAssessmentManager();
                    IQSecurityCallback sec = new CourseIQSecurityCallback(this, am, ureq.getIdentity());
                    controller = new IQRunController(userCourseEnv, getModuleConfiguration(), sec, ureq, wControl, this, testEntry);
                } else {
                    String title = trans.translate("editor.lock.title");
                    String message = trans.translate("editor.lock.message");
                    controller = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
                }
            }
        }
    }
    Controller ctrl = TitledWrapperHelper.getWrapper(ureq, wControl, controller, this, "o_iqtest_icon");
    return new NodeRunConstructionResult(ctrl);
}
Also used : QTI21AssessmentRunController(org.olat.course.nodes.iq.QTI21AssessmentRunController) ModuleConfiguration(org.olat.modules.ModuleConfiguration) CourseIQSecurityCallback(org.olat.course.nodes.iq.CourseIQSecurityCallback) IQRunController(org.olat.course.nodes.iq.IQRunController) AssessmentManager(org.olat.course.assessment.AssessmentManager) OLATResource(org.olat.resource.OLATResource) Roles(org.olat.core.id.Roles) RepositoryEntry(org.olat.repository.RepositoryEntry) QTI21AssessmentRunController(org.olat.course.nodes.iq.QTI21AssessmentRunController) IQIdentityListCourseNodeController(org.olat.course.nodes.iq.IQIdentityListCourseNodeController) IQRunController(org.olat.course.nodes.iq.IQRunController) QTI21AssessmentDetailsController(org.olat.ims.qti21.ui.QTI21AssessmentDetailsController) IQPreviewController(org.olat.course.nodes.iq.IQPreviewController) IQEditController(org.olat.course.nodes.iq.IQEditController) NodeEditController(org.olat.course.editor.NodeEditController) QTI12ResultDetailsController(org.olat.ims.qti.QTI12ResultDetailsController) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) AssessmentCourseNodeController(org.olat.course.assessment.ui.tool.AssessmentCourseNodeController) Controller(org.olat.core.gui.control.Controller) TestFileResource(org.olat.ims.qti.fileresource.TestFileResource) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult) Translator(org.olat.core.gui.translator.Translator) IQSecurityCallback(org.olat.modules.iq.IQSecurityCallback) CourseIQSecurityCallback(org.olat.course.nodes.iq.CourseIQSecurityCallback)

Aggregations

NodeRunConstructionResult (org.olat.course.run.navigation.NodeRunConstructionResult)72 Controller (org.olat.core.gui.control.Controller)62 NodeEditController (org.olat.course.editor.NodeEditController)62 TabbableController (org.olat.core.gui.control.generic.tabbable.TabbableController)60 Translator (org.olat.core.gui.translator.Translator)36 Roles (org.olat.core.id.Roles)36 ConditionEditController (org.olat.course.condition.ConditionEditController)22 AssessmentCourseNodeController (org.olat.course.assessment.ui.tool.AssessmentCourseNodeController)20 RepositoryEntry (org.olat.repository.RepositoryEntry)18 PackageTranslator (org.olat.core.gui.translator.PackageTranslator)12 OLATResourceable (org.olat.core.id.OLATResourceable)10 IdentityListCourseNodeController (org.olat.course.assessment.ui.tool.IdentityListCourseNodeController)8 SubscriptionContext (org.olat.core.commons.services.notifications.SubscriptionContext)6 ICourse (org.olat.course.ICourse)6 AssessmentManager (org.olat.course.assessment.AssessmentManager)6 CourseIQSecurityCallback (org.olat.course.nodes.iq.CourseIQSecurityCallback)6 IQEditController (org.olat.course.nodes.iq.IQEditController)6 RepositoryManager (org.olat.repository.RepositoryManager)6 BusinessControl (org.olat.core.id.context.BusinessControl)4 BusinessControlFactory (org.olat.core.id.context.BusinessControlFactory)4