use of org.olat.course.run.navigation.NodeRunConstructionResult in project OpenOLAT by OpenOLAT.
the class CalCourseNode 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)
*/
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
updateModuleConfigDefaults(false);
CalRunController calCtlr = new CalRunController(wControl, ureq, this, userCourseEnv, ne);
Controller wrapperCtrl = TitledWrapperHelper.getWrapper(ureq, wControl, calCtlr, this, "o_cal_icon");
return new NodeRunConstructionResult(wrapperCtrl);
}
use of org.olat.course.run.navigation.NodeRunConstructionResult in project OpenOLAT by OpenOLAT.
the class Card2BrainCourseNode method createNodeRunConstructionResult.
@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
updateModuleConfigDefaults(false);
Controller runCtrl;
if (userCourseEnv.isCourseReadOnly()) {
Translator trans = Util.createPackageTranslator(Card2BrainCourseNode.class, ureq.getLocale());
String title = trans.translate("freezenoaccess.title");
String message = trans.translate("freezenoaccess.message");
runCtrl = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
} else if (userCourseEnv.getIdentityEnvironment().getRoles().isGuestOnly()) {
Translator trans = Util.createPackageTranslator(Card2BrainCourseNode.class, ureq.getLocale());
String title = trans.translate("guestnoaccess.title");
String message = trans.translate("guestnoaccess.message");
runCtrl = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
} else {
runCtrl = new Card2BrainRunController(ureq, wControl, this.getModuleConfiguration());
}
Controller ctrl = TitledWrapperHelper.getWrapper(ureq, wControl, runCtrl, this, "o_card2brain_icon");
return new NodeRunConstructionResult(ctrl);
}
use of org.olat.course.run.navigation.NodeRunConstructionResult in project OpenOLAT by OpenOLAT.
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 OpenOLAT.
the class IQSELFCourseNode 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 runController;
ModuleConfiguration config = getModuleConfiguration();
AssessmentManager am = userCourseEnv.getCourseEnvironment().getAssessmentManager();
boolean onyx = IQEditController.CONFIG_VALUE_QTI2.equals(config.get(IQEditController.CONFIG_KEY_TYPE_QTI));
if (onyx) {
Translator trans = Util.createPackageTranslator(IQEditController.class, ureq.getLocale());
runController = MessageUIFactory.createInfoMessage(ureq, wControl, "", trans.translate("error.onyx"));
} else {
RepositoryEntry testEntry = getReferencedRepositoryEntry();
if (ImsQTI21Resource.TYPE_NAME.equals(testEntry.getOlatResource().getResourceableTypeName())) {
runController = new QTI21AssessmentRunController(ureq, wControl, userCourseEnv, this);
} else {
IQSecurityCallback sec = new CourseIQSecurityCallback(this, am, ureq.getIdentity());
runController = new IQRunController(userCourseEnv, getModuleConfiguration(), sec, ureq, wControl, this);
}
}
Controller ctrl = TitledWrapperHelper.getWrapper(ureq, wControl, runController, this, "o_iqself_icon");
return new NodeRunConstructionResult(ctrl);
}
use of org.olat.course.run.navigation.NodeRunConstructionResult in project OpenOLAT by OpenOLAT.
the class IQTESTCourseNode method createNodeRunConstructionResult.
@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
updateModuleConfigDefaults(false);
Controller controller;
// Do not allow guests to start tests
Roles roles = ureq.getUserSession().getRoles();
Translator trans = Util.createPackageTranslator(IQTESTCourseNode.class, ureq.getLocale());
if (roles.isGuestOnly()) {
if (isGuestAllowedForQTI21(getReferencedRepositoryEntry())) {
controller = new QTI21AssessmentRunController(ureq, wControl, userCourseEnv, this);
} else {
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 transe = Util.createPackageTranslator(IQEditController.class, ureq.getLocale());
controller = MessageUIFactory.createInfoMessage(ureq, wControl, "", transe.translate("error.onyx"));
} else {
RepositoryEntry testEntry = getReferencedRepositoryEntry();
OLATResource ores = testEntry.getOlatResource();
if (ImsQTI21Resource.TYPE_NAME.equals(ores.getResourceableTypeName())) {
// QTI 2.1
controller = new QTI21AssessmentRunController(ureq, wControl, userCourseEnv, this);
} else {
// QTI 1.2
TestFileResource fr = new TestFileResource();
fr.overrideResourceableId(ores.getResourceableId());
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, testEntry);
} else {
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_iqtest_icon");
return new NodeRunConstructionResult(ctrl);
}
Aggregations