Search in sources :

Example 41 with Condition

use of org.olat.course.condition.Condition in project openolat by klemens.

the class IQEditController method event.

@Override
public void event(UserRequest urequest, Controller source, Event event) {
    if (source == accessibilityCondContr) {
        if (event == Event.CHANGED_EVENT) {
            Condition cond = accessibilityCondContr.getCondition();
            courseNode.setPreConditionAccess(cond);
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == configurationCtrl) {
        if (event == NodeEditController.NODECONFIG_CHANGED_EVENT) {
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
            layoutConfigurationCtrl.updateEditController(urequest);
        }
    } else if (source == highScoreNodeConfigController) {
        if (event == Event.DONE_EVENT) {
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == layoutConfigurationCtrl) {
        if (event == NodeEditController.NODECONFIG_CHANGED_EVENT) {
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
            configurationCtrl.updateEditController(urequest, false);
            layoutConfigurationCtrl.updateEditController(urequest);
        }
    }
}
Also used : Condition(org.olat.course.condition.Condition)

Example 42 with Condition

use of org.olat.course.condition.Condition in project openolat by klemens.

the class MSCourseNodeEditController 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)
 */
@Override
public void event(UserRequest ureq, Controller source, Event event) {
    if (source == accessibilityCondContr) {
        if (event == Event.CHANGED_EVENT) {
            Condition cond = accessibilityCondContr.getCondition();
            msNode.setPreConditionAccess(cond);
            fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == modConfigController) {
        if (event == Event.CANCELLED_EVENT) {
            if (modConfigController != null) {
                removeAsListenerAndDispose(modConfigController);
            }
            modConfigController = new MSEditFormController(ureq, getWindowControl(), msNode.getModuleConfiguration());
            listenTo(modConfigController);
            configurationVC.put("mseditform", modConfigController.getInitialComponent());
            if (hasLogEntries) {
                modConfigController.setDisplayOnly(true);
            }
            configurationVC.contextPut("isOverwriting", new Boolean(false));
            return;
        } else if (event == Event.DONE_EVENT) {
            modConfigController.updateModuleConfiguration(msNode.getModuleConfiguration());
            fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
        updateHighscoreTab();
    } else if (source == highScoreNodeConfigController) {
        if (event == Event.DONE_EVENT) {
            fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    }
}
Also used : Condition(org.olat.course.condition.Condition)

Example 43 with Condition

use of org.olat.course.condition.Condition in project openolat by klemens.

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

Example 44 with Condition

use of org.olat.course.condition.Condition in project openolat by klemens.

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 45 with Condition

use of org.olat.course.condition.Condition in project openolat by klemens.

the class ChecklistEditController method event.

/**
 * {@inheritDoc}
 */
@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 == checklistFormContr && event == Event.CHANGED_EVENT) {
        // checklist = ChecklistManager.getInstance().saveChecklist(checklist);
        fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
    } else if (source == manageController && event == Event.DONE_EVENT) {
        cmcManage.deactivate();
    } else if (event == NodeEditController.NODECONFIG_CHANGED_EVENT) {
        // update title and description according to the course node
        Checklist cl = ChecklistManager.getInstance().loadChecklist(checklist);
        cl.setTitle(courseNode.getShortTitle());
        cl.setDescription(courseNode.getLongTitle());
        checklist = ChecklistManager.getInstance().saveChecklist(cl);
    }
}
Also used : Condition(org.olat.course.condition.Condition) Checklist(de.bps.olat.modules.cl.Checklist)

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