use of org.olat.course.condition.Condition in project openolat by klemens.
the class CompMenuForm 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) {
if (event == ReferencableEntriesSearchController.EVENT_REPOSITORY_ENTRY_SELECTED) {
// search controller done
// -> close closeable modal controller
cmc.deactivate();
RepositoryEntry re = searchController.getSelectedEntry();
if (re != null) {
setCPReference(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.setCustomEnabledLinkCSS("o_preview");
previewLink.setTitle(getTranslator().translate("command.preview"));
// remove existing edit link, add new one if user is allowed to edit this CP
if (editLink != null) {
cpConfigurationVc.remove(editLink);
editLink = null;
}
if (isEditable(urequest.getIdentity(), urequest.getUserSession().getRoles(), re)) {
editLink = LinkFactory.createButtonSmall("edit", cpConfigurationVc, this);
}
// fire event so the updated config is saved by the editormaincontroller
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
CPPackageConfig cpConfig = CPManager.getInstance().getCPPackageConfig(re.getOlatResource());
if (cpConfig != null && cpConfig.getDeliveryOptions() != null) {
deliveryOptionsCtrl.setParentDeliveryOptions(cpConfig.getDeliveryOptions());
}
}
}
// else cancelled repo search
} else if (source == accessibilityCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = accessibilityCondContr.getCondition();
cpNode.setPreConditionAccess(cond);
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == cpMenuForm) {
if (event == Event.DONE_EVENT) {
config.setBooleanEntry(NodeEditController.CONFIG_COMPONENT_MENU, cpMenuForm.isCpMenu());
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == deliveryOptionsCtrl) {
if (event == Event.DONE_EVENT || event == Event.CHANGED_EVENT) {
config.set(CPEditController.CONFIG_DELIVERYOPTIONS, deliveryOptionsCtrl.getDeliveryOptions());
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
}
}
use of org.olat.course.condition.Condition in project openolat by klemens.
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 klemens.
the class IQEditController method init.
private void init(UserRequest ureq) {
configurationCtrl = new IQConfigurationController(ureq, getWindowControl(), stackPanel, course, courseNode, type);
listenTo(configurationCtrl);
layoutConfigurationCtrl = new IQLayoutConfigurationController(ureq, getWindowControl(), course, courseNode, type);
listenTo(layoutConfigurationCtrl);
if (AssessmentInstance.QMD_ENTRY_TYPE_ASSESS.equals(type)) {
highScoreNodeConfigController = new HighScoreEditController(ureq, getWindowControl(), moduleConfiguration);
listenTo(highScoreNodeConfigController);
}
Condition accessCondition = courseNode.getPreConditionAccess();
accessibilityCondContr = new ConditionEditController(ureq, getWindowControl(), euce, accessCondition, AssessmentHelper.getAssessableNodes(course.getEditorTreeModel(), courseNode));
listenTo(accessibilityCondContr);
}
use of org.olat.course.condition.Condition in project openolat by klemens.
the class InfoCourseNodeEditController method event.
@Override
public void event(UserRequest ureq, Controller source, Event event) {
if (source == infoConfigForm) {
if (event == Event.DONE_EVENT) {
infoConfigForm.getUpdatedConfig();
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == accessCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = accessCondContr.getCondition();
courseNode.setPreConditionAccess(cond);
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == editCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = editCondContr.getCondition();
courseNode.setPreConditionEdit(cond);
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == adminCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = adminCondContr.getCondition();
courseNode.setPreConditionAdmin(cond);
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
}
}
use of org.olat.course.condition.Condition in project openolat by klemens.
the class STCourseNode method getScoreCalculator.
/**
* @return Returns the scoreCalculator.
*/
@Override
public ScoreCalculator getScoreCalculator() {
if (scoreCalculator == null) {
scoreCalculator = new ScoreCalculator();
scoreCalculator.setFailedType(FailedEvaluationType.failedAsNotPassedAfterEndDate);
}
passedExpression = new Condition();
passedExpression.setConditionId("passed");
if (scoreCalculator.getPassedExpression() != null) {
passedExpression.setConditionExpression(scoreCalculator.getPassedExpression());
passedExpression.setExpertMode(true);
}
scoreExpression = new Condition();
scoreExpression.setConditionId("score");
if (scoreCalculator.getScoreExpression() != null) {
scoreExpression.setConditionExpression(scoreCalculator.getScoreExpression());
scoreExpression.setExpertMode(true);
}
failedExpression = new Condition();
failedExpression.setConditionId("failed");
if (scoreCalculator.getFailedExpression() != null) {
failedExpression.setConditionExpression(scoreCalculator.getFailedExpression());
failedExpression.setExpertMode(true);
}
return scoreCalculator;
}
Aggregations