use of org.olat.course.run.navigation.NodeRunConstructionResult in project openolat by klemens.
the class CPRunController method createNodeRunConstructionResult.
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, String selectedNodeId) {
NodeRunConstructionResult ncr;
if (isExternalMenuConfigured()) {
// integrate it into the olat menu
Controller ctrl = TitledWrapperHelper.getWrapper(ureq, getWindowControl(), this, cpNode, "o_cp_icon");
if (StringHelper.containsNonWhitespace(selectedNodeId) && treeModel.getNodeById(selectedNodeId) != null) {
selNodeId = selectedNodeId;
}
ncr = new NodeRunConstructionResult(ctrl, treeModel, selNodeId, treeNodeClickListener);
} else {
// no menu to integrate
Controller ctrl = TitledWrapperHelper.getWrapper(ureq, getWindowControl(), this, cpNode, "o_cp_icon");
ncr = new NodeRunConstructionResult(ctrl);
}
return ncr;
}
use of org.olat.course.run.navigation.NodeRunConstructionResult in project openolat by klemens.
the class IQSURVCourseNode 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 start questionnaires
Roles roles = ureq.getUserSession().getRoles();
if (roles.isGuestOnly()) {
Translator trans = Util.createPackageTranslator(IQSURVCourseNode.class, ureq.getLocale());
String title = trans.translate("guestnoaccess.title");
String message = trans.translate("guestnoaccess.message");
controller = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
} else {
ModuleConfiguration config = getModuleConfiguration();
boolean onyx = IQEditController.CONFIG_VALUE_QTI2.equals(config.get(IQEditController.CONFIG_KEY_TYPE_QTI));
if (onyx) {
Translator trans = Util.createPackageTranslator(IQEditController.class, ureq.getLocale());
controller = MessageUIFactory.createInfoMessage(ureq, wControl, "", trans.translate("error.onyx"));
} else {
RepositoryEntry repositoryEntry = getReferencedRepositoryEntry();
OLATResourceable ores = repositoryEntry.getOlatResource();
Long resId = ores.getResourceableId();
SurveyFileResource fr = new SurveyFileResource();
fr.overrideResourceableId(resId);
if (!CoordinatorManager.getInstance().getCoordinator().getLocker().isLocked(fr, null)) {
AssessmentManager am = userCourseEnv.getCourseEnvironment().getAssessmentManager();
IQSecurityCallback sec = new CourseIQSecurityCallback(this, am, ureq.getIdentity());
controller = new IQRunController(userCourseEnv, getModuleConfiguration(), sec, ureq, wControl, this);
} else {
Translator trans = Util.createPackageTranslator(IQSURVCourseNode.class, ureq.getLocale());
String title = trans.translate("editor.lock.title");
String message = trans.translate("editor.lock.message");
controller = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
}
}
}
Controller ctrl = TitledWrapperHelper.getWrapper(ureq, wControl, controller, this, "o_iqsurv_icon");
return new NodeRunConstructionResult(ctrl);
}
use of org.olat.course.run.navigation.NodeRunConstructionResult in project openolat by klemens.
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);
}
use of org.olat.course.run.navigation.NodeRunConstructionResult in project openolat by klemens.
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);
}
use of org.olat.course.run.navigation.NodeRunConstructionResult in project openolat by klemens.
the class SPCourseNode 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);
VFSContainer container = userCourseEnv.getCourseEnvironment().getCourseFolderContainer();
SPRunController runController = new SPRunController(wControl, ureq, userCourseEnv, this, container);
return new NodeRunConstructionResult(runController);
}
Aggregations