use of org.olat.course.condition.Condition in project OpenOLAT by OpenOLAT.
the class CalEditController 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 ureq, Controller source, Event event) {
if (source == displayForm) {
if (event == Event.DONE_EVENT) {
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == accessCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = accessCondContr.getCondition();
calCourseNode.setPreConditionAccess(cond);
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == editCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = editCondContr.getCondition();
calCourseNode.setPreConditionEdit(cond);
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
}
}
use of org.olat.course.condition.Condition in project OpenOLAT by OpenOLAT.
the class WikiEditController 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 == searchController) {
cmcSearchController.deactivate();
// repository search controller done
if (event == ReferencableEntriesSearchController.EVENT_REPOSITORY_ENTRY_SELECTED) {
RepositoryEntry re = searchController.getSelectedEntry();
if (re != null) {
setWikiRepoReference(re, moduleConfiguration);
content.contextPut("showPreviewLink", Boolean.TRUE);
String displayname = StringHelper.escapeHtml(re.getDisplayname());
previewLink = LinkFactory.createCustomLink("command.preview", "command.preview", displayname, Link.NONTRANSLATED, content, this);
previewLink.setIconLeftCSS("o_icon o_icon-fw o_icon_preview");
previewLink.setCustomEnabledLinkCSS("o_preview");
previewLink.setTitle(getTranslator().translate("command.preview"));
// no securitycheck on wiki, editable by everybody
editLink = LinkFactory.createButtonSmall("edit", content, this);
// fire event so the updated config is saved by the
// editormaincontroller
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
}
// else cancelled repo search
} else if (source == accessCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = accessCondContr.getCondition();
wikiCourseNode.setPreConditionAccess(cond);
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == editCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = editCondContr.getCondition();
wikiCourseNode.setPreConditionEdit(cond);
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == cmcWikiCtr) {
if (event == CloseableModalController.CLOSE_MODAL_EVENT) {
cmcWikiCtr.dispose();
wikiCtr.dispose();
}
}
}
use of org.olat.course.condition.Condition in project OpenOLAT by OpenOLAT.
the class GTAEditController method event.
@Override
protected void event(UserRequest ureq, Controller source, Event event) {
if (source == accessibilityCondCtrl) {
if (event == Event.CHANGED_EVENT) {
Condition cond = accessibilityCondCtrl.getCondition();
gtaNode.setPreConditionAccess(cond);
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (workflowCtrl == source) {
if (event == Event.DONE_EVENT) {
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
updateEnabledDisabledTabs();
} else if (event == Event.CANCELLED_EVENT) {
removeAsListenerAndDispose(workflowCtrl);
workflowCtrl = new GTAWorkflowEditController(ureq, getWindowControl(), gtaNode, euce.getCourseEditorEnv());
listenTo(workflowCtrl);
myTabbedPane.replaceTab(workflowPos, workflowCtrl.getInitialComponent());
}
} else if (assignmentCtrl == source) {
if (event == Event.DONE_EVENT) {
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
} else if (event == Event.CANCELLED_EVENT) {
removeAsListenerAndDispose(assignmentCtrl);
assignmentCtrl = new GTAAssignmentEditController(ureq, getWindowControl(), gtaNode, config, courseEnv, false);
listenTo(assignmentCtrl);
myTabbedPane.replaceTab(assignmentPos, assignmentCtrl.getInitialComponent());
}
} else if (submissionCtrl == source) {
if (event == Event.DONE_EVENT) {
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
if (revisionCtrl != null) {
revisionCtrl.updateDefaultMaximumNumberOfDocuments();
}
} else if (event == Event.CANCELLED_EVENT) {
removeAsListenerAndDispose(submissionCtrl);
submissionCtrl = new GTASubmissionEditController(ureq, getWindowControl(), config);
listenTo(submissionCtrl);
myTabbedPane.replaceTab(submissionPos, submissionCtrl.getInitialComponent());
}
} else if (revisionCtrl == source) {
if (event == Event.DONE_EVENT) {
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
} else if (event == Event.CANCELLED_EVENT) {
removeAsListenerAndDispose(revisionCtrl);
revisionCtrl = new GTARevisionAndCorrectionEditController(ureq, getWindowControl(), config);
listenTo(revisionCtrl);
myTabbedPane.replaceTab(revisionPos, revisionCtrl.getInitialComponent());
}
} else if (manualAssessmentCtrl == source) {
if (event == Event.DONE_EVENT) {
manualAssessmentCtrl.updateModuleConfiguration(config);
updateEnabledDisabledTabs();
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
} else if (event == Event.CANCELLED_EVENT) {
removeAsListenerAndDispose(manualAssessmentCtrl);
manualAssessmentCtrl = new MSEditFormController(ureq, getWindowControl(), config);
listenTo(manualAssessmentCtrl);
myTabbedPane.replaceTab(gradingPos, manualAssessmentCtrl.getInitialComponent());
}
} else if (solutionsCtrl == source) {
if (event == Event.DONE_EVENT || event == Event.CHANGED_EVENT) {
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == highScoreNodeConfigController) {
if (event == Event.DONE_EVENT) {
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
}
super.event(ureq, source, event);
}
use of org.olat.course.condition.Condition in project OpenOLAT by OpenOLAT.
the class VarForm 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 == searchController) {
cmc.deactivate();
if (event == ReferencableEntriesSearchController.EVENT_REPOSITORY_ENTRY_SELECTED) {
// search controller done
RepositoryEntry re = searchController.getSelectedEntry();
if (re != null) {
setScormCPReference(re, config);
cpConfigurationVc.contextPut("showPreviewButton", Boolean.TRUE);
String displayname = StringHelper.escapeHtml(re.getDisplayname());
previewLink = LinkFactory.createCustomLink("command.preview", "command.preview", displayname, Link.NONTRANSLATED, cpConfigurationVc, this);
previewLink.setIconLeftCSS("o_icon o_icon-fw o_icon_preview");
previewLink.setCustomEnabledLinkCSS("o_preview");
previewLink.setTitle(getTranslator().translate("command.preview"));
// fire event so the updated config is saved by the
// editormaincontroller
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
ScormPackageConfig scormConfig = ScormMainManager.getInstance().getScormPackageConfig(re.getOlatResource());
DeliveryOptions parentConfig = scormConfig == null ? null : scormConfig.getDeliveryOptions();
deliveryOptionsCtrl.setParentDeliveryOptions(parentConfig);
}
// else cancelled repo search
}
} else if (source == accessibilityCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = accessibilityCondContr.getCondition();
scormNode.setPreConditionAccess(cond);
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == scorevarform) {
if (event == Event.DONE_EVENT) {
// save form-values to config
config.setBooleanEntry(CONFIG_SHOWMENU, scorevarform.isShowMenu());
config.setBooleanEntry(CONFIG_SKIPLAUNCHPAGE, scorevarform.isSkipLaunchPage());
config.setBooleanEntry(CONFIG_SHOWNAVBUTTONS, scorevarform.isShowNavButtons());
config.setBooleanEntry(CONFIG_ISASSESSABLE, scorevarform.isAssessable());
config.setStringValue(CONFIG_ASSESSABLE_TYPE, scorevarform.getAssessableType());
config.setIntValue(CONFIG_CUTVALUE, scorevarform.getCutValue());
config.setBooleanEntry(CONFIG_FULLWINDOW, scorevarform.isFullWindow());
config.setBooleanEntry(CONFIG_CLOSE_ON_FINISH, scorevarform.isCloseOnFinish());
// <OLATCE-289>
config.setIntValue(CONFIG_MAXATTEMPTS, scorevarform.getAttemptsValue());
config.setBooleanEntry(CONFIG_ADVANCESCORE, scorevarform.isAdvanceScore());
config.setBooleanEntry(CONFIG_ATTEMPTSDEPENDONSCORE, scorevarform.getAttemptsDependOnScore());
// </OLATCE-289>
// fire event so the updated config is saved by the
// editormaincontroller
updateHighscoreTab();
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == deliveryOptionsCtrl) {
if (event == Event.DONE_EVENT || event == Event.CHANGED_EVENT) {
config.set(CONFIG_DELIVERY_OPTIONS, deliveryOptionsCtrl.getDeliveryOptions());
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == highScoreNodeConfigController) {
if (event == Event.DONE_EVENT) {
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
}
}
use of org.olat.course.condition.Condition in project openolat by klemens.
the class CheckListEditController method event.
@Override
public void event(UserRequest ureq, Controller source, Event event) {
if (source == accessibilityCondCtrl) {
if (event == Event.DONE_EVENT || event == Event.CHANGED_EVENT) {
Condition cond = accessibilityCondCtrl.getCondition();
courseNode.setPreConditionAccess(cond);
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == configurationCtrl) {
if (event == Event.DONE_EVENT || event == Event.CHANGED_EVENT) {
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
checkboxListEditCtrl.dispatchEvent(ureq, configurationCtrl, event);
updateHighscoreTab();
}
} else if (source == checkboxListEditCtrl) {
if (event == Event.DONE_EVENT || event == Event.CHANGED_EVENT) {
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
configurationCtrl.dispatchEvent(ureq, checkboxListEditCtrl, event);
}
} else if (source == highScoreNodeConfigController) {
if (event == Event.DONE_EVENT) {
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
}
}
Aggregations