Search in sources :

Example 1 with CheckListRunController

use of org.olat.course.nodes.cl.ui.CheckListRunController in project openolat by klemens.

the class CheckListCourseNode 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, final UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    updateModuleConfigDefaults(false);
    Controller ctrl;
    OLATResourceable ores = OresHelper.createOLATResourceableInstance("CourseModule", userCourseEnv.getCourseEnvironment().getCourseResourceableId());
    Roles roles = ureq.getUserSession().getRoles();
    if (roles.isGuestOnly()) {
        Translator trans = Util.createPackageTranslator(CheckListCourseNode.class, ureq.getLocale());
        String title = trans.translate("guestnoaccess.title");
        String message = trans.translate("guestnoaccess.message");
        ctrl = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
    } else if (userCourseEnv.isCoach() || userCourseEnv.isAdmin()) {
        ctrl = new CheckListRunForCoachController(ureq, wControl, userCourseEnv, ores, this);
    } else {
        ctrl = new CheckListRunController(ureq, wControl, userCourseEnv, ores, this);
    }
    Controller cont = TitledWrapperHelper.getWrapper(ureq, wControl, ctrl, this, ICON_CSS_CLASS);
    return new NodeRunConstructionResult(cont);
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) Translator(org.olat.core.gui.translator.Translator) CheckListRunForCoachController(org.olat.course.nodes.cl.ui.CheckListRunForCoachController) Roles(org.olat.core.id.Roles) CheckListRunController(org.olat.course.nodes.cl.ui.CheckListRunController) AssessedIdentityCheckListController(org.olat.course.nodes.cl.ui.AssessedIdentityCheckListController) NodeEditController(org.olat.course.editor.NodeEditController) 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) CheckListEditController(org.olat.course.nodes.cl.ui.CheckListEditController) Controller(org.olat.core.gui.control.Controller) CheckListRunController(org.olat.course.nodes.cl.ui.CheckListRunController) CheckListRunForCoachController(org.olat.course.nodes.cl.ui.CheckListRunForCoachController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult)

Example 2 with CheckListRunController

use of org.olat.course.nodes.cl.ui.CheckListRunController in project OpenOLAT by OpenOLAT.

the class CheckListCourseNode 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, final UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    updateModuleConfigDefaults(false);
    Controller ctrl;
    OLATResourceable ores = OresHelper.createOLATResourceableInstance("CourseModule", userCourseEnv.getCourseEnvironment().getCourseResourceableId());
    Roles roles = ureq.getUserSession().getRoles();
    if (roles.isGuestOnly()) {
        Translator trans = Util.createPackageTranslator(CheckListCourseNode.class, ureq.getLocale());
        String title = trans.translate("guestnoaccess.title");
        String message = trans.translate("guestnoaccess.message");
        ctrl = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
    } else if (userCourseEnv.isCoach() || userCourseEnv.isAdmin()) {
        ctrl = new CheckListRunForCoachController(ureq, wControl, userCourseEnv, ores, this);
    } else {
        ctrl = new CheckListRunController(ureq, wControl, userCourseEnv, ores, this);
    }
    Controller cont = TitledWrapperHelper.getWrapper(ureq, wControl, ctrl, this, ICON_CSS_CLASS);
    return new NodeRunConstructionResult(cont);
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) Translator(org.olat.core.gui.translator.Translator) CheckListRunForCoachController(org.olat.course.nodes.cl.ui.CheckListRunForCoachController) Roles(org.olat.core.id.Roles) CheckListRunController(org.olat.course.nodes.cl.ui.CheckListRunController) AssessedIdentityCheckListController(org.olat.course.nodes.cl.ui.AssessedIdentityCheckListController) NodeEditController(org.olat.course.editor.NodeEditController) 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) CheckListEditController(org.olat.course.nodes.cl.ui.CheckListEditController) Controller(org.olat.core.gui.control.Controller) CheckListRunController(org.olat.course.nodes.cl.ui.CheckListRunController) CheckListRunForCoachController(org.olat.course.nodes.cl.ui.CheckListRunForCoachController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult)

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 OLATResourceable (org.olat.core.id.OLATResourceable)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 AssessedIdentityCheckListController (org.olat.course.nodes.cl.ui.AssessedIdentityCheckListController)2 CheckListEditController (org.olat.course.nodes.cl.ui.CheckListEditController)2 CheckListRunController (org.olat.course.nodes.cl.ui.CheckListRunController)2 CheckListRunForCoachController (org.olat.course.nodes.cl.ui.CheckListRunForCoachController)2 NodeRunConstructionResult (org.olat.course.run.navigation.NodeRunConstructionResult)2