Search in sources :

Example 1 with MSEditFormController

use of org.olat.course.nodes.ms.MSEditFormController 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 2 with MSEditFormController

use of org.olat.course.nodes.ms.MSEditFormController in project openolat by klemens.

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)

Aggregations

Condition (org.olat.course.condition.Condition)2 MSEditFormController (org.olat.course.nodes.ms.MSEditFormController)2