Search in sources :

Example 86 with Condition

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

the class InfoCourseNode 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 87 with Condition

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

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

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

the class BCCourseNodeEditController 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 urequest, Controller source, Event event) {
    if (source == uploaderCondContr) {
        if (event == Event.CHANGED_EVENT) {
            Condition cond = uploaderCondContr.getCondition();
            bcNode.setPreConditionUploaders(cond);
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == downloaderCondContr) {
        if (event == Event.CHANGED_EVENT) {
            Condition cond = downloaderCondContr.getCondition();
            bcNode.setPreConditionDownloaders(cond);
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == folderPathChoose) {
        if (bcNode.getModuleConfiguration().getStringValue(CONFIG_SUBPATH, "").startsWith("/_sharedfolder")) {
            accessabiliryContent.contextPut("uploadable", false);
        } else {
            accessabiliryContent.contextPut("uploadable", true);
        }
        fireEvent(urequest, event);
    } else if (cmc == source) {
        cleanUp();
    }
}
Also used : Condition(org.olat.course.condition.Condition)

Example 89 with Condition

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

the class FOCourseNodeEditController 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 urequest, Controller source, Event event) {
    if (source == readerCondContr) {
        if (event == Event.CHANGED_EVENT) {
            Condition cond = readerCondContr.getCondition();
            foNode.setPreConditionReader(cond);
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == posterCondContr) {
        if (event == Event.CHANGED_EVENT) {
            Condition cond = posterCondContr.getCondition();
            foNode.setPreConditionPoster(cond);
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == moderatorCondContr) {
        if (event == Event.CHANGED_EVENT) {
            Condition cond = moderatorCondContr.getCondition();
            foNode.setPreConditionModerator(cond);
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == settingsCtrl) {
        if (event == Event.CHANGED_EVENT) {
            String pseudoAllowed = settingsCtrl.isPseudonymPostAllowed() ? "true" : "false";
            foNode.getModuleConfiguration().setStringValue(PSEUDONYM_POST_ALLOWED, pseudoAllowed);
            String defaultPseudo = settingsCtrl.isDefaultPseudonym() ? "true" : "false";
            foNode.getModuleConfiguration().setStringValue(PSEUDONYM_POST_DEFAULT, defaultPseudo);
            String guestAllowed = settingsCtrl.isGuestPostAllowed() ? "true" : "false";
            foNode.getModuleConfiguration().setStringValue(GUEST_POST_ALLOWED, guestAllowed);
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    }
}
Also used : Condition(org.olat.course.condition.Condition)

Example 90 with Condition

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

the class PortfolioCourseNodeEditController method event.

@Override
public 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 == configForm) {
        if (event == Event.DONE_EVENT) {
            configForm.getUpdatedConfig();
            fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
            textForm.loadMapOrBinder();
            textForm.updateUI();
            configContent.setDirty(true);
        }
    } else if (source == textForm) {
        if (event == Event.DONE_EVENT) {
            textForm.getUpdatedConfig();
            configForm.setDirtyFromOtherForm(false);
            fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
        } else if (event == Event.CHANGED_EVENT) {
            // disable modification in other forms!
            configForm.setDirtyFromOtherForm(true);
        }
    } else if (source == scoringController) {
        if (event == Event.CANCELLED_EVENT) {
            if (hasLogEntries) {
                scoringController.setDisplayOnly(true);
            }
            configContent.contextPut("isOverwriting", new Boolean(false));
            return;
        } else if (event == Event.DONE_EVENT) {
            scoringController.updateModuleConfiguration(config);
            updateHighscoreTab();
            fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_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