Search in sources :

Example 46 with NodeRunConstructionResult

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

the class MSCourseNode 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 controller;
    // Do not allow guests to have manual scoring
    Roles roles = ureq.getUserSession().getRoles();
    if (roles.isGuestOnly()) {
        Translator trans = Util.createPackageTranslator(MSCourseNode.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 MSCourseNodeRunController(ureq, wControl, userCourseEnv, this, true, true);
    }
    Controller wrappedCtrl = TitledWrapperHelper.getWrapper(ureq, wControl, controller, this, "o_ms_icon");
    return new NodeRunConstructionResult(wrappedCtrl);
}
Also used : MSCourseNodeRunController(org.olat.course.nodes.ms.MSCourseNodeRunController) PackageTranslator(org.olat.core.gui.translator.PackageTranslator) Translator(org.olat.core.gui.translator.Translator) Roles(org.olat.core.id.Roles) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) MSEditFormController(org.olat.course.nodes.ms.MSEditFormController) AssessmentCourseNodeController(org.olat.course.assessment.ui.tool.AssessmentCourseNodeController) MSIdentityListCourseNodeController(org.olat.course.nodes.ms.MSIdentityListCourseNodeController) MSCourseNodeRunController(org.olat.course.nodes.ms.MSCourseNodeRunController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) MSCourseNodeEditController(org.olat.course.nodes.ms.MSCourseNodeEditController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult)

Example 47 with NodeRunConstructionResult

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

the class ProjectBrokerCourseNode 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 {
        // Add message id to business path if nodemcd is available
        if (nodecmd != null) {
            try {
                Long projectId = Long.valueOf(nodecmd);
                BusinessControlFactory bcf = BusinessControlFactory.getInstance();
                BusinessControl businessControl = bcf.createFromString("[Project:" + projectId + "]");
                wControl = bcf.createBusinessWindowControl(businessControl, wControl);
            } catch (NumberFormatException e) {
                // ups, nodecmd is not a message, what the heck is it then?
                log.warn("Could not create message ID from given nodemcd::" + nodecmd, e);
            }
        }
        controller = ProjectBrokerControllerFactory.createRunController(ureq, wControl, userCourseEnv, this);
    }
    Controller wrapperCtrl = TitledWrapperHelper.getWrapper(ureq, wControl, controller, this, "o_projectbroker_icon");
    return new NodeRunConstructionResult(wrapperCtrl);
}
Also used : PackageTranslator(org.olat.core.gui.translator.PackageTranslator) Translator(org.olat.core.gui.translator.Translator) PackageTranslator(org.olat.core.gui.translator.PackageTranslator) BusinessControl(org.olat.core.id.context.BusinessControl) Roles(org.olat.core.id.Roles) BusinessControlFactory(org.olat.core.id.context.BusinessControlFactory) MSEditFormController(org.olat.course.nodes.ms.MSEditFormController) 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) ProjectBrokerIdentityListCourseNodeController(org.olat.course.nodes.projectbroker.ProjectBrokerIdentityListCourseNodeController) AssessmentCourseNodeController(org.olat.course.assessment.ui.tool.AssessmentCourseNodeController) ProjectBrokerCourseEditorController(org.olat.course.nodes.projectbroker.ProjectBrokerCourseEditorController) ProjectListController(org.olat.course.nodes.projectbroker.ProjectListController) ReturnboxController(org.olat.course.nodes.ta.ReturnboxController) Controller(org.olat.core.gui.control.Controller) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult)

Example 48 with NodeRunConstructionResult

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

the class ScormCourseNode method createPreviewController.

/**
 * @see org.olat.course.nodes.GenericCourseNode#createPreviewController(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 Controller createPreviewController(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne) {
    updateModuleConfigDefaults(false);
    ScormRunController cprunC = new ScormRunController(getModuleConfiguration(), ureq, userCourseEnv, wControl, this, true);
    return new NodeRunConstructionResult(cprunC).getRunController();
}
Also used : ScormRunController(org.olat.course.nodes.scorm.ScormRunController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult)

Example 49 with NodeRunConstructionResult

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

the class ScormCourseNode 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);
    ScormRunController cprunC = new ScormRunController(getModuleConfiguration(), ureq, userCourseEnv, wControl, this, false);
    Controller ctrl = TitledWrapperHelper.getWrapper(ureq, wControl, cprunC, this, "o_scorm_icon");
    // no inline-in-olat-menu integration possible: no display configuration option
    return new NodeRunConstructionResult(ctrl);
}
Also used : ScormRunController(org.olat.course.nodes.scorm.ScormRunController) ScormEditController(org.olat.course.nodes.scorm.ScormEditController) CPEditController(org.olat.course.nodes.cp.CPEditController) 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) Controller(org.olat.core.gui.control.Controller) ScormRunController(org.olat.course.nodes.scorm.ScormRunController) ScormResultDetailsController(org.olat.modules.scorm.assessment.ScormResultDetailsController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult)

Example 50 with NodeRunConstructionResult

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

the class VideoCourseNode method createNodeRunConstructionResult.

@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    NodeRunConstructionResult ncr;
    updateModuleConfigDefaults(false);
    VideoRunController cprunC = new VideoRunController(getModuleConfiguration(), wControl, ureq, userCourseEnv, this);
    ncr = cprunC.createNodeRunConstructionResult(ureq);
    return ncr;
}
Also used : NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult) VideoRunController(org.olat.course.nodes.video.VideoRunController)

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