Search in sources :

Example 11 with NodeRunConstructionResult

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

the class MembersCourseNode method createNodeRunConstructionResult.

@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    updateModuleConfigDefaults(false);
    Controller controller;
    Roles roles = ureq.getUserSession().getRoles();
    if (roles.isGuestOnly()) {
        Translator trans = Util.createPackageTranslator(CourseNode.class, ureq.getLocale());
        String title = trans.translate("guestnoaccess.title");
        String message = trans.translate("guestnoaccess.message");
        controller = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
    } else {
        controller = new MembersCourseNodeRunController(ureq, wControl, userCourseEnv, this.getModuleConfiguration());
    }
    Controller titledCtrl = TitledWrapperHelper.getWrapper(ureq, wControl, controller, this, "o_cmembers_icon");
    return new NodeRunConstructionResult(titledCtrl);
}
Also used : Translator(org.olat.core.gui.translator.Translator) Roles(org.olat.core.id.Roles) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) MembersPeekViewController(org.olat.course.nodes.members.MembersPeekViewController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) MembersCourseNodeRunController(org.olat.course.nodes.members.MembersCourseNodeRunController) MembersCourseNodeEditController(org.olat.course.nodes.members.MembersCourseNodeEditController) InfoCourseNodeEditController(org.olat.course.nodes.info.InfoCourseNodeEditController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult) MembersCourseNodeRunController(org.olat.course.nodes.members.MembersCourseNodeRunController)

Example 12 with NodeRunConstructionResult

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

the class OpenMeetingsCourseNode method createNodeRunConstructionResult.

@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    updateModuleConfigDefaults(false);
    Roles roles = ureq.getUserSession().getRoles();
    // check if user is moderator of the virtual classroom
    boolean admin = roles.isOLATAdmin();
    boolean moderator = admin;
    RepositoryEntry re = userCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
    if (!admin) {
        RepositoryManager rm = RepositoryManager.getInstance();
        if (re != null) {
            admin = rm.isOwnerOfRepositoryEntry(ureq.getIdentity(), re) || rm.isInstitutionalRessourceManagerFor(ureq.getIdentity(), roles, re);
            moderator = admin || rm.isIdentityInTutorSecurityGroup(ureq.getIdentity(), re) || isCoach(re, ureq.getIdentity());
        }
    }
    // create run controller
    OLATResourceable ores = OresHelper.clone(userCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseResource());
    Controller runCtr = new OpenMeetingsRunController(ureq, wControl, null, ores, getIdent(), admin, moderator, userCourseEnv.isCourseReadOnly());
    Controller controller = TitledWrapperHelper.getWrapper(ureq, wControl, runCtr, this, "o_openmeetings_icon");
    return new NodeRunConstructionResult(controller);
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) OpenMeetingsRunController(org.olat.modules.openmeetings.ui.OpenMeetingsRunController) Roles(org.olat.core.id.Roles) RepositoryManager(org.olat.repository.RepositoryManager) RepositoryEntry(org.olat.repository.RepositoryEntry) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) OpenMeetingsEditController(org.olat.course.nodes.openmeetings.OpenMeetingsEditController) OpenMeetingsPeekViewController(org.olat.course.nodes.openmeetings.OpenMeetingsPeekViewController) OpenMeetingsRunController(org.olat.modules.openmeetings.ui.OpenMeetingsRunController) CPEditController(org.olat.course.nodes.cp.CPEditController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) OpenMeetingsRoomEditController(org.olat.modules.openmeetings.ui.OpenMeetingsRoomEditController) ConditionEditController(org.olat.course.condition.ConditionEditController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult)

Example 13 with NodeRunConstructionResult

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

the class TACourseNode 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 controller;
    // Do not allow guests to access tasks
    Roles roles = ureq.getUserSession().getRoles();
    if (roles.isGuestOnly()) {
        Translator trans = new PackageTranslator(PACKAGE, ureq.getLocale());
        String title = trans.translate(NLS_GUESTNOACCESS_TITLE);
        String message = trans.translate(NLS_GUESTNOACCESS_MESSAGE);
        controller = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
    } else {
        controller = new TACourseNodeRunController(ureq, wControl, userCourseEnv, this, ne, false);
    }
    Controller ctrl = TitledWrapperHelper.getWrapper(ureq, wControl, controller, this, "o_ta_icon");
    return new NodeRunConstructionResult(ctrl);
}
Also used : PackageTranslator(org.olat.core.gui.translator.PackageTranslator) Translator(org.olat.core.gui.translator.Translator) PackageTranslator(org.olat.core.gui.translator.PackageTranslator) TACourseNodeRunController(org.olat.course.nodes.ta.TACourseNodeRunController) Roles(org.olat.core.id.Roles) MSEditFormController(org.olat.course.nodes.ms.MSEditFormController) TACourseNodeRunController(org.olat.course.nodes.ta.TACourseNodeRunController) TAIdentityListCourseNodeController(org.olat.course.nodes.ta.TAIdentityListCourseNodeController) TACourseNodeEditController(org.olat.course.nodes.ta.TACourseNodeEditController) TaskController(org.olat.course.nodes.ta.TaskController) NodeEditController(org.olat.course.editor.NodeEditController) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) DropboxController(org.olat.course.nodes.ta.DropboxController) AssessmentCourseNodeController(org.olat.course.assessment.ui.tool.AssessmentCourseNodeController) DropboxScoringViewController(org.olat.course.nodes.ta.DropboxScoringViewController) ReturnboxController(org.olat.course.nodes.ta.ReturnboxController) Controller(org.olat.core.gui.control.Controller) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult)

Example 14 with NodeRunConstructionResult

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

the class ViteroCourseNode method createNodeRunConstructionResult.

@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    updateModuleConfigDefaults(false);
    Controller runCtr;
    Roles roles = ureq.getUserSession().getRoles();
    if (roles.isGuestOnly()) {
        Translator trans = Util.createPackageTranslator(ViteroPeekViewController.class, ureq.getLocale());
        String title = trans.translate("guestnoaccess.title");
        String message = trans.translate("guestnoaccess.message");
        runCtr = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
    } else {
        // check if user is moderator of the virtual classroom
        boolean moderator = roles.isOLATAdmin();
        Long key = userCourseEnv.getCourseEnvironment().getCourseResourceableId();
        if (!moderator) {
            if (roles.isInstitutionalResourceManager() | roles.isAuthor()) {
                RepositoryManager rm = RepositoryManager.getInstance();
                ICourse course = CourseFactory.loadCourse(key);
                RepositoryEntry re = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
                if (re != null) {
                    moderator = rm.isOwnerOfRepositoryEntry(ureq.getIdentity(), re);
                    if (!moderator) {
                        moderator = rm.isInstitutionalRessourceManagerFor(ureq.getIdentity(), ureq.getUserSession().getRoles(), re);
                    }
                }
            }
        }
        // create run controller
        Long resourceId = userCourseEnv.getCourseEnvironment().getCourseResourceableId();
        OLATResourceable ores = OresHelper.createOLATResourceableInstance(CourseModule.class, resourceId);
        String courseTitle = userCourseEnv.getCourseEnvironment().getCourseTitle();
        runCtr = new ViteroBookingsRunController(ureq, wControl, null, ores, getIdent(), courseTitle, moderator, userCourseEnv.isCourseReadOnly());
    }
    Controller controller = TitledWrapperHelper.getWrapper(ureq, wControl, runCtr, this, "o_vitero_icon");
    return new NodeRunConstructionResult(controller);
}
Also used : Translator(org.olat.core.gui.translator.Translator) OLATResourceable(org.olat.core.id.OLATResourceable) Roles(org.olat.core.id.Roles) RepositoryManager(org.olat.repository.RepositoryManager) ICourse(org.olat.course.ICourse) ViteroBookingsRunController(org.olat.modules.vitero.ui.ViteroBookingsRunController) RepositoryEntry(org.olat.repository.RepositoryEntry) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) ViteroBookingsRunController(org.olat.modules.vitero.ui.ViteroBookingsRunController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) ViteroEditController(org.olat.course.nodes.vitero.ViteroEditController) ViteroPeekViewController(org.olat.course.nodes.vitero.ViteroPeekViewController) ConditionEditController(org.olat.course.condition.ConditionEditController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult)

Example 15 with NodeRunConstructionResult

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

the class COCourseNode 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 controller;
    // Do not allow guests to send anonymous emails
    Roles roles = ureq.getUserSession().getRoles();
    if (roles.isGuestOnly()) {
        Translator trans = Util.createPackageTranslator(COCourseNode.class, ureq.getLocale());
        String title = trans.translate("guestnoaccess.title");
        String message = trans.translate("guestnoaccess.message");
        controller = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
    } else if (userCourseEnv.isCourseReadOnly()) {
        Translator trans = Util.createPackageTranslator(COCourseNode.class, ureq.getLocale());
        String title = trans.translate("freezenoaccess.title");
        String message = trans.translate("freezenoaccess.message");
        controller = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
    } else {
        controller = new CORunController(getModuleConfiguration(), ureq, wControl, userCourseEnv);
    }
    Controller ctrl = TitledWrapperHelper.getWrapper(ureq, wControl, controller, this, "o_co_icon");
    return new NodeRunConstructionResult(ctrl);
}
Also used : CORunController(org.olat.course.nodes.co.CORunController) Translator(org.olat.core.gui.translator.Translator) Roles(org.olat.core.id.Roles) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) CORunController(org.olat.course.nodes.co.CORunController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) COEditController(org.olat.course.nodes.co.COEditController) ConditionEditController(org.olat.course.condition.ConditionEditController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult)

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