Search in sources :

Example 21 with Condition

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);
        }
    }
}
Also used : Condition(org.olat.course.condition.Condition)

Example 22 with Condition

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();
        }
    }
}
Also used : Condition(org.olat.course.condition.Condition) RepositoryEntry(org.olat.repository.RepositoryEntry)

Example 23 with Condition

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);
}
Also used : Condition(org.olat.course.condition.Condition) MSEditFormController(org.olat.course.nodes.ms.MSEditFormController)

Example 24 with Condition

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);
        }
    }
}
Also used : Condition(org.olat.course.condition.Condition) ScormPackageConfig(org.olat.modules.scorm.ScormPackageConfig) RepositoryEntry(org.olat.repository.RepositoryEntry) DeliveryOptions(org.olat.core.gui.control.generic.iframe.DeliveryOptions)

Example 25 with Condition

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);
        }
    }
}
Also used : Condition(org.olat.course.condition.Condition)

Aggregations

Condition (org.olat.course.condition.Condition)94 ModuleConfiguration (org.olat.modules.ModuleConfiguration)10 ArrayList (java.util.ArrayList)8 CourseNode (org.olat.course.nodes.CourseNode)8 RepositoryEntry (org.olat.repository.RepositoryEntry)8 ConditionExpression (org.olat.course.condition.interpreter.ConditionExpression)6 Checklist (de.bps.olat.modules.cl.Checklist)4 DeliveryOptions (org.olat.core.gui.control.generic.iframe.DeliveryOptions)4 ICourse (org.olat.course.ICourse)4 ConditionEditController (org.olat.course.condition.ConditionEditController)4 NodeEditController (org.olat.course.editor.NodeEditController)4 StatusDescription (org.olat.course.editor.StatusDescription)4 AbstractAccessableCourseNode (org.olat.course.nodes.AbstractAccessableCourseNode)4 ScoreCalculator (org.olat.course.run.scoring.ScoreCalculator)4 CourseEditorTreeNode (org.olat.course.tree.CourseEditorTreeNode)4 CourseNodeVO (org.olat.restapi.support.vo.CourseNodeVO)4 ChecklistEditController (de.bps.course.nodes.cl.ChecklistEditController)2 Checkpoint (de.bps.olat.modules.cl.Checkpoint)2 Date (java.util.Date)2 List (java.util.List)2