Search in sources :

Example 1 with TACourseNodeRunController

use of org.olat.course.nodes.ta.TACourseNodeRunController 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 2 with TACourseNodeRunController

use of org.olat.course.nodes.ta.TACourseNodeRunController in project openolat by klemens.

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)

Aggregations

Controller (org.olat.core.gui.control.Controller)2 TabbableController (org.olat.core.gui.control.generic.tabbable.TabbableController)2 PackageTranslator (org.olat.core.gui.translator.PackageTranslator)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 NodeEditController (org.olat.course.editor.NodeEditController)2 MSEditFormController (org.olat.course.nodes.ms.MSEditFormController)2 DropboxController (org.olat.course.nodes.ta.DropboxController)2 DropboxScoringViewController (org.olat.course.nodes.ta.DropboxScoringViewController)2 ReturnboxController (org.olat.course.nodes.ta.ReturnboxController)2 TACourseNodeEditController (org.olat.course.nodes.ta.TACourseNodeEditController)2 TACourseNodeRunController (org.olat.course.nodes.ta.TACourseNodeRunController)2 TAIdentityListCourseNodeController (org.olat.course.nodes.ta.TAIdentityListCourseNodeController)2 TaskController (org.olat.course.nodes.ta.TaskController)2 NodeRunConstructionResult (org.olat.course.run.navigation.NodeRunConstructionResult)2