use of org.olat.course.condition.Condition in project openolat by klemens.
the class CalCourseNode method updateModuleConfigDefaults.
@Override
public void updateModuleConfigDefaults(boolean isNewNode) {
ModuleConfiguration config = getModuleConfiguration();
if (isNewNode) {
// use defaults for new course building blocks
config.setBooleanEntry(NodeEditController.CONFIG_STARTPAGE, false);
config.setConfigurationVersion(1);
} else {
if (config.getConfigurationVersion() < 2) {
Condition cond = getPreConditionEdit();
if (!cond.isExpertMode() && cond.isEasyModeCoachesAndAdmins() && cond.getConditionExpression() == null) {
// ensure that the default config has a condition expression
cond.setConditionExpression(cond.getConditionFromEasyModeConfiguration());
}
config.setConfigurationVersion(2);
}
}
}
use of org.olat.course.condition.Condition in project openolat by klemens.
the class NodeEditController method event.
/**
* @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
* org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
*/
@Override
public void event(UserRequest urequest, Controller source, Event event) {
if (source == visibilityCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = visibilityCondContr.getCondition();
courseNode.setPreConditionVisibility(cond);
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == noAccessContr) {
if (event == Event.CHANGED_EVENT) {
String noAccessExplanation = noAccessContr.getNoAccessExplanation();
courseNode.setNoAccessExplanation(noAccessExplanation);
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == childTabsCntrllr) {
if (event == NodeEditController.NODECONFIG_CHANGED_EVENT) {
// fire child controller request further
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == nodeConfigController) {
if (event == Event.DONE_EVENT) {
courseNode.setShortTitle(nodeConfigController.getMenuTitle());
courseNode.setLongTitle(nodeConfigController.getDisplayTitle());
courseNode.setLearningObjectives(nodeConfigController.getLearningObjectives());
courseNode.setDisplayOption(nodeConfigController.getDisplayOption());
}
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
// do logging
ThreadLocalUserActivityLogger.log(CourseLoggingAction.COURSE_EDITOR_NODE_EDITED, getClass());
}
use of org.olat.course.condition.Condition in project openolat by klemens.
the class ENEditController method init.
/**
* @param config
* @param ureq
* @param enCourseNode
* @param course
* @param euce
*/
private void init(ModuleConfiguration config, UserRequest ureq, ENCourseNode enCourseNode, ICourse courseP, UserCourseEnvironment euceP) {
this.moduleConfiguration = config;
this.courseNode = enCourseNode;
this.euce = euceP;
myContent = createVelocityContainer("edit");
doFormInit(ureq);
// Accessibility precondition
Condition accessCondition = courseNode.getPreConditionAccess();
accessibilityCondContr = new ConditionEditController(ureq, getWindowControl(), euceP, accessCondition, AssessmentHelper.getAssessableNodes(courseP.getEditorTreeModel(), enCourseNode));
listenTo(accessibilityCondContr);
// not needed: setInitialComponent(myContent) since tabbable controller
}
use of org.olat.course.condition.Condition in project openolat by klemens.
the class ENEditController method event.
/**
* @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
* org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
*/
public void event(UserRequest urequest, Controller source, Event event) {
if (source == accessibilityCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = accessibilityCondContr.getCondition();
courseNode.setPreConditionAccess(cond);
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == easyGroupEditCtrllr) {
// somehting changed in the nodeconfig
moduleConfiguration = easyGroupEditCtrllr.getModuleConfiguration();
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
}
use of org.olat.course.condition.Condition in project openolat by klemens.
the class DialogCourseNodeEditController method event.
@Override
public void event(UserRequest ureq, Controller source, Event event) {
if (source == elementsEditCtrl) {
if (event == Event.CHANGED_EVENT) {
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == readerCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = readerCondContr.getCondition();
courseNode.setPreConditionReader(cond);
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == posterCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = posterCondContr.getCondition();
courseNode.setPreConditionPoster(cond);
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == moderatorCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = moderatorCondContr.getCondition();
courseNode.setPreConditionModerator(cond);
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
}
}
Aggregations