Search in sources :

Example 46 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 47 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 48 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 49 with Condition

use of org.olat.course.condition.Condition in project OpenOLAT by OpenOLAT.

the class AbstractCourseNodeWebService method createExpertCondition.

protected Condition createExpertCondition(String conditionId, String expertRules) {
    Condition cond = new Condition();
    cond.setConditionExpression(expertRules);
    cond.setExpertMode(true);
    cond.setConditionId(conditionId);
    return cond;
}
Also used : Condition(org.olat.course.condition.Condition)

Example 50 with Condition

use of org.olat.course.condition.Condition in project OpenOLAT by OpenOLAT.

the class ENEditController method init.

/**
 * @param config
 * @param ureq
 * @param enCourseNode
 * @param course
 * @param euce
 */
private void init(ModuleConfiguration config, UserRequest ureq, ENCourseNode enCourseNode, ICourse courseP, UserCourseEnvironment euceP) {
    this.moduleConfiguration = config;
    this.courseNode = enCourseNode;
    this.euce = euceP;
    myContent = createVelocityContainer("edit");
    doFormInit(ureq);
    // Accessibility precondition
    Condition accessCondition = courseNode.getPreConditionAccess();
    accessibilityCondContr = new ConditionEditController(ureq, getWindowControl(), euceP, accessCondition, AssessmentHelper.getAssessableNodes(courseP.getEditorTreeModel(), enCourseNode));
    listenTo(accessibilityCondContr);
// not needed: setInitialComponent(myContent) since tabbable controller
}
Also used : Condition(org.olat.course.condition.Condition) ConditionEditController(org.olat.course.condition.ConditionEditController)

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