use of org.olat.course.condition.Condition in project OpenOLAT by OpenOLAT.
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);
}
}
}
use of org.olat.course.condition.Condition in project OpenOLAT by OpenOLAT.
the class PortfolioCourseNodeEditController method event.
@Override
public void event(UserRequest ureq, Controller source, Event event) {
if (source == accessibilityCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = accessibilityCondContr.getCondition();
courseNode.setPreConditionAccess(cond);
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == configForm) {
if (event == Event.DONE_EVENT) {
configForm.getUpdatedConfig();
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
textForm.loadMapOrBinder();
textForm.updateUI();
configContent.setDirty(true);
}
} else if (source == textForm) {
if (event == Event.DONE_EVENT) {
textForm.getUpdatedConfig();
configForm.setDirtyFromOtherForm(false);
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
} else if (event == Event.CHANGED_EVENT) {
// disable modification in other forms!
configForm.setDirtyFromOtherForm(true);
}
} else if (source == scoringController) {
if (event == Event.CANCELLED_EVENT) {
if (hasLogEntries) {
scoringController.setDisplayOnly(true);
}
configContent.contextPut("isOverwriting", new Boolean(false));
return;
} else if (event == Event.DONE_EVENT) {
scoringController.updateModuleConfiguration(config);
updateHighscoreTab();
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == highScoreNodeConfigController) {
if (event == Event.DONE_EVENT) {
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
}
}
use of org.olat.course.condition.Condition in project OpenOLAT by OpenOLAT.
the class PortfolioCourseNode method getPreConditionEdit.
/**
* Default set the write privileges to coaches and admin only
* @return
*/
public Condition getPreConditionEdit() {
if (preConditionEdit == null) {
preConditionEdit = new Condition();
preConditionEdit.setEasyModeCoachesAndAdmins(true);
preConditionEdit.setConditionExpression(preConditionEdit.getConditionFromEasyModeConfiguration());
preConditionEdit.setExpertMode(false);
}
preConditionEdit.setConditionId(EDIT_CONDITION_ID);
return preConditionEdit;
}
use of org.olat.course.condition.Condition in project OpenOLAT by OpenOLAT.
the class WikiCourseNode method getConditionExpressions.
@Override
public List<ConditionExpression> getConditionExpressions() {
List<ConditionExpression> parentConditions = super.getConditionExpressions();
List<ConditionExpression> conditions = new ArrayList<>();
if (parentConditions != null && parentConditions.size() > 0) {
conditions.addAll(parentConditions);
}
Condition editCondition = getPreConditionEdit();
if (editCondition != null && StringHelper.containsNonWhitespace(editCondition.getConditionExpression())) {
ConditionExpression ce = new ConditionExpression(editCondition.getConditionId());
ce.setExpressionString(editCondition.getConditionExpression());
conditions.add(ce);
}
return conditions;
}
use of org.olat.course.condition.Condition in project OpenOLAT by OpenOLAT.
the class PFEditController method event.
@Override
protected void event(UserRequest ureq, Controller source, Event event) {
if (source == accessibilityCondCtr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = accessibilityCondCtr.getCondition();
pfNode.setPreConditionAccess(cond);
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == modConfigCtr) {
if (Event.DONE_EVENT.equals(event)) {
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
}
super.event(ureq, source, event);
}
Aggregations