use of org.olat.course.condition.Condition in project OpenOLAT by OpenOLAT.
the class OpenMeetingsEditController method event.
@Override
protected 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 == editForm) {
// config form action
if (event == Event.DONE_EVENT || event == Event.CHANGED_EVENT) {
OpenMeetingsRoom room = editForm.getRoom();
if (room != null) {
ModuleConfiguration moduleConfiguration = courseNode.getModuleConfiguration();
moduleConfiguration.set(CONFIG_ROOM_NAME, room.getName());
moduleConfiguration.set(CONFIG_ROOM_SIZE, new Long(room.getSize()));
moduleConfiguration.set(CONFIG_ROOM_MODERATION, new Boolean(room.isModerated()));
moduleConfiguration.set(CONFIG_ROOM_AUDIO_ONLY, new Boolean(room.isAudioOnly()));
moduleConfiguration.set(CONFIG_ROOM_COMMENT, room.getComment());
moduleConfiguration.set(CONFIG_ROOM_TYPE, new Long(room.getType()));
}
}
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 GoToMeetingEditController method event.
@Override
protected 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);
}
}
}
use of org.olat.course.condition.Condition in project OpenOLAT by OpenOLAT.
the class DialogCourseNode method getPreConditionModerator.
/**
* @return Returns the preConditionModerator.
*/
public Condition getPreConditionModerator() {
if (this.preConditionModerator == null) {
this.preConditionModerator = new Condition();
// learner should not be able to delete files by default
this.preConditionModerator.setEasyModeCoachesAndAdmins(true);
this.preConditionModerator.setEasyModeAlwaysAllowCoachesAndAdmins(true);
this.preConditionModerator.setConditionExpression("( ( isCourseCoach(0) | isCourseAdministrator(0) ) )");
}
this.preConditionModerator.setConditionId("moderator");
return this.preConditionModerator;
}
use of org.olat.course.condition.Condition in project OpenOLAT by OpenOLAT.
the class InfoCourseNode 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);
}
Condition adminCondition = getPreConditionAdmin();
if (adminCondition != null && StringHelper.containsNonWhitespace(adminCondition.getConditionExpression())) {
ConditionExpression ce = new ConditionExpression(adminCondition.getConditionId());
ce.setExpressionString(adminCondition.getConditionExpression());
conditions.add(ce);
}
return conditions;
}
use of org.olat.course.condition.Condition in project OpenOLAT by OpenOLAT.
the class InfoCourseNode method getPreConditionAdmin.
/**
* Default set the write privileges to coaches and admin only
* @return
*/
public Condition getPreConditionAdmin() {
if (preConditionAdmin == null) {
preConditionAdmin = new Condition();
preConditionAdmin.setEasyModeCoachesAndAdmins(true);
preConditionAdmin.setConditionExpression(preConditionAdmin.getConditionFromEasyModeConfiguration());
preConditionAdmin.setExpertMode(false);
}
preConditionAdmin.setConditionId(ADMIN_CONDITION_ID);
return preConditionAdmin;
}
Aggregations