Search in sources :

Example 76 with Condition

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

the class CalCourseNode method updateModuleConfigDefaults.

@Override
public void updateModuleConfigDefaults(boolean isNewNode) {
    ModuleConfiguration config = getModuleConfiguration();
    if (isNewNode) {
        // use defaults for new course building blocks
        config.setBooleanEntry(NodeEditController.CONFIG_STARTPAGE, false);
        config.setConfigurationVersion(1);
    } else {
        if (config.getConfigurationVersion() < 2) {
            Condition cond = getPreConditionEdit();
            if (!cond.isExpertMode() && cond.isEasyModeCoachesAndAdmins() && cond.getConditionExpression() == null) {
                // ensure that the default config has a condition expression
                cond.setConditionExpression(cond.getConditionFromEasyModeConfiguration());
            }
            config.setConfigurationVersion(2);
        }
    }
}
Also used : Condition(org.olat.course.condition.Condition) ModuleConfiguration(org.olat.modules.ModuleConfiguration)

Example 77 with Condition

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

the class NodeEditController 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 == visibilityCondContr) {
        if (event == Event.CHANGED_EVENT) {
            Condition cond = visibilityCondContr.getCondition();
            courseNode.setPreConditionVisibility(cond);
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == noAccessContr) {
        if (event == Event.CHANGED_EVENT) {
            String noAccessExplanation = noAccessContr.getNoAccessExplanation();
            courseNode.setNoAccessExplanation(noAccessExplanation);
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == childTabsCntrllr) {
        if (event == NodeEditController.NODECONFIG_CHANGED_EVENT) {
            // fire child controller request further
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == nodeConfigController) {
        if (event == Event.DONE_EVENT) {
            courseNode.setShortTitle(nodeConfigController.getMenuTitle());
            courseNode.setLongTitle(nodeConfigController.getDisplayTitle());
            courseNode.setLearningObjectives(nodeConfigController.getLearningObjectives());
            courseNode.setDisplayOption(nodeConfigController.getDisplayOption());
        }
        fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
    }
    // do logging
    ThreadLocalUserActivityLogger.log(CourseLoggingAction.COURSE_EDITOR_NODE_EDITED, getClass());
}
Also used : Condition(org.olat.course.condition.Condition)

Example 78 with Condition

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

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)

Example 79 with Condition

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

the class ENEditController 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 == accessibilityCondContr) {
        if (event == Event.CHANGED_EVENT) {
            Condition cond = accessibilityCondContr.getCondition();
            courseNode.setPreConditionAccess(cond);
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == easyGroupEditCtrllr) {
        // somehting changed in the nodeconfig
        moduleConfiguration = easyGroupEditCtrllr.getModuleConfiguration();
        fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
    }
}
Also used : Condition(org.olat.course.condition.Condition)

Example 80 with Condition

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

the class DialogCourseNodeEditController method event.

@Override
public void event(UserRequest ureq, Controller source, Event event) {
    if (source == elementsEditCtrl) {
        if (event == Event.CHANGED_EVENT) {
            fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == readerCondContr) {
        if (event == Event.CHANGED_EVENT) {
            Condition cond = readerCondContr.getCondition();
            courseNode.setPreConditionReader(cond);
            fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == posterCondContr) {
        if (event == Event.CHANGED_EVENT) {
            Condition cond = posterCondContr.getCondition();
            courseNode.setPreConditionPoster(cond);
            fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == moderatorCondContr) {
        if (event == Event.CHANGED_EVENT) {
            Condition cond = moderatorCondContr.getCondition();
            courseNode.setPreConditionModerator(cond);
            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