Search in sources :

Example 1 with LTIRunController

use of org.olat.course.nodes.basiclti.LTIRunController in project OpenOLAT by OpenOLAT.

the class BasicLTICourseNode 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) {
    updateModuleConfigDefaults(false);
    Controller runCtrl;
    if (userCourseEnv.isCourseReadOnly()) {
        Translator trans = Util.createPackageTranslator(BasicLTICourseNode.class, ureq.getLocale());
        String title = trans.translate("freezenoaccess.title");
        String message = trans.translate("freezenoaccess.message");
        runCtrl = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
    } else {
        Roles roles = ureq.getUserSession().getRoles();
        if (roles.isGuestOnly()) {
            if (isGuestAllowed()) {
                Translator trans = Util.createPackageTranslator(BasicLTICourseNode.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 LTIRunController(wControl, getModuleConfiguration(), ureq, this, userCourseEnv);
            }
        } else {
            runCtrl = new LTIRunController(wControl, getModuleConfiguration(), ureq, this, userCourseEnv);
        }
    }
    Controller ctrl = TitledWrapperHelper.getWrapper(ureq, wControl, runCtrl, this, "o_lti_icon");
    return new NodeRunConstructionResult(ctrl);
}
Also used : Translator(org.olat.core.gui.translator.Translator) Roles(org.olat.core.id.Roles) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) IdentityListCourseNodeController(org.olat.course.assessment.ui.tool.IdentityListCourseNodeController) AssessmentCourseNodeController(org.olat.course.assessment.ui.tool.AssessmentCourseNodeController) LTIResultDetailsController(org.olat.ims.lti.ui.LTIResultDetailsController) LTIEditController(org.olat.course.nodes.basiclti.LTIEditController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) LTIRunController(org.olat.course.nodes.basiclti.LTIRunController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult) LTIRunController(org.olat.course.nodes.basiclti.LTIRunController)

Example 2 with LTIRunController

use of org.olat.course.nodes.basiclti.LTIRunController in project openolat by klemens.

the class BasicLTICourseNode 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) {
    updateModuleConfigDefaults(false);
    Controller runCtrl;
    if (userCourseEnv.isCourseReadOnly()) {
        Translator trans = Util.createPackageTranslator(BasicLTICourseNode.class, ureq.getLocale());
        String title = trans.translate("freezenoaccess.title");
        String message = trans.translate("freezenoaccess.message");
        runCtrl = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
    } else {
        Roles roles = ureq.getUserSession().getRoles();
        if (roles.isGuestOnly()) {
            if (isGuestAllowed()) {
                Translator trans = Util.createPackageTranslator(BasicLTICourseNode.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 LTIRunController(wControl, getModuleConfiguration(), ureq, this, userCourseEnv);
            }
        } else {
            runCtrl = new LTIRunController(wControl, getModuleConfiguration(), ureq, this, userCourseEnv);
        }
    }
    Controller ctrl = TitledWrapperHelper.getWrapper(ureq, wControl, runCtrl, this, "o_lti_icon");
    return new NodeRunConstructionResult(ctrl);
}
Also used : Translator(org.olat.core.gui.translator.Translator) Roles(org.olat.core.id.Roles) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) IdentityListCourseNodeController(org.olat.course.assessment.ui.tool.IdentityListCourseNodeController) AssessmentCourseNodeController(org.olat.course.assessment.ui.tool.AssessmentCourseNodeController) LTIResultDetailsController(org.olat.ims.lti.ui.LTIResultDetailsController) LTIEditController(org.olat.course.nodes.basiclti.LTIEditController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) LTIRunController(org.olat.course.nodes.basiclti.LTIRunController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult) LTIRunController(org.olat.course.nodes.basiclti.LTIRunController)

Aggregations

Controller (org.olat.core.gui.control.Controller)2 TabbableController (org.olat.core.gui.control.generic.tabbable.TabbableController)2 Translator (org.olat.core.gui.translator.Translator)2 Roles (org.olat.core.id.Roles)2 AssessmentCourseNodeController (org.olat.course.assessment.ui.tool.AssessmentCourseNodeController)2 IdentityListCourseNodeController (org.olat.course.assessment.ui.tool.IdentityListCourseNodeController)2 NodeEditController (org.olat.course.editor.NodeEditController)2 LTIEditController (org.olat.course.nodes.basiclti.LTIEditController)2 LTIRunController (org.olat.course.nodes.basiclti.LTIRunController)2 NodeRunConstructionResult (org.olat.course.run.navigation.NodeRunConstructionResult)2 LTIResultDetailsController (org.olat.ims.lti.ui.LTIResultDetailsController)2