Search in sources :

Example 6 with AssessmentSectionEvent

use of org.olat.ims.qti21.ui.editor.events.AssessmentSectionEvent in project openolat by klemens.

the class AssessmentTestComposerController method event.

@Override
protected void event(UserRequest ureq, Controller source, Event event) {
    if (event instanceof AssessmentTestEvent) {
        AssessmentTestEvent ate = (AssessmentTestEvent) event;
        if (ate == AssessmentTestEvent.ASSESSMENT_TEST_CHANGED_EVENT) {
            doSaveAssessmentTest(ureq, null);
        }
    } else if (event instanceof AssessmentTestPartEvent) {
        AssessmentTestPartEvent atpe = (AssessmentTestPartEvent) event;
        if (atpe == AssessmentTestPartEvent.ASSESSMENT_TEST_PART_CHANGED_EVENT) {
            doSaveAssessmentTest(ureq, null);
        }
    } else if (event instanceof AssessmentSectionEvent) {
        AssessmentSectionEvent ase = (AssessmentSectionEvent) event;
        if (AssessmentSectionEvent.ASSESSMENT_SECTION_CHANGED.equals(ase.getCommand())) {
            doSaveAssessmentTest(ureq, null);
            doUpdate(ase.getSection().getIdentifier(), ase.getSection().getTitle());
            doSaveManifest();
        }
    } else if (event instanceof AssessmentItemEvent) {
        AssessmentItemEvent aie = (AssessmentItemEvent) event;
        if (AssessmentItemEvent.ASSESSMENT_ITEM_CHANGED.equals(aie.getCommand())) {
            assessmentChanged(ureq);
            doSaveAssessmentTest(ureq, null);
            doUpdate(aie.getAssessmentItemRef().getIdentifier(), aie.getAssessmentItem().getTitle());
            doSaveManifest();
        } else if (AssessmentItemEvent.ASSESSMENT_ITEM_METADATA_CHANGED.equals(aie.getCommand())) {
            doSaveManifest();
        } else if (AssessmentItemEvent.ASSESSMENT_ITEM_NEED_RELOAD.equals(aie.getCommand())) {
            doReloadItem(ureq);
        }
    } else if (event instanceof DetachFromPoolEvent) {
        DetachFromPoolEvent dfpe = (DetachFromPoolEvent) event;
        doDetachItemFromPool(ureq, dfpe.getItemRef());
    } else if (selectQItemCtrl == source) {
        cmc.deactivate();
        cleanUp();
        if (event instanceof QItemViewEvent) {
            QItemViewEvent e = (QItemViewEvent) event;
            List<QuestionItemView> items = e.getItemList();
            doInsert(ureq, items);
        }
    } else if (importTableWizard == source) {
        AssessmentItemsPackage importPackage = (AssessmentItemsPackage) importTableWizard.getRunContext().get("importPackage");
        getWindowControl().pop();
        cleanUp();
        if (event == Event.DONE_EVENT || event == Event.CHANGED_EVENT) {
            doInsert(ureq, importPackage);
        }
    } else if (confirmDeleteCtrl == source) {
        if (DialogBoxUIFactory.isYesEvent(event)) {
            // yes, delete
            doDelete(ureq, (TreeNode) confirmDeleteCtrl.getUserObject());
        }
        cleanUp();
    } else if (cmc == source) {
        cleanUp();
    }
    super.event(ureq, source, event);
}
Also used : AssessmentTestEvent(org.olat.ims.qti21.ui.editor.events.AssessmentTestEvent) DetachFromPoolEvent(org.olat.ims.qti21.ui.editor.events.DetachFromPoolEvent) TreeNode(org.olat.core.gui.components.tree.TreeNode) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) AssessmentItemsPackage(org.olat.ims.qti21.questionimport.AssessmentItemsPackage) ArrayList(java.util.ArrayList) List(java.util.List) QItemViewEvent(org.olat.modules.qpool.ui.events.QItemViewEvent) AssessmentSectionEvent(org.olat.ims.qti21.ui.editor.events.AssessmentSectionEvent) AssessmentTestPartEvent(org.olat.ims.qti21.ui.editor.events.AssessmentTestPartEvent) AssessmentItemEvent(org.olat.ims.qti21.ui.editor.events.AssessmentItemEvent)

Aggregations

AssessmentSectionEvent (org.olat.ims.qti21.ui.editor.events.AssessmentSectionEvent)6 ArrayList (java.util.ArrayList)4 List (java.util.List)2 RichTextElement (org.olat.core.gui.components.form.flexible.elements.RichTextElement)2 SingleSelection (org.olat.core.gui.components.form.flexible.elements.SingleSelection)2 GenericTreeNode (org.olat.core.gui.components.tree.GenericTreeNode)2 TreeNode (org.olat.core.gui.components.tree.TreeNode)2 AssessmentItemsPackage (org.olat.ims.qti21.questionimport.AssessmentItemsPackage)2 AssessmentItemEvent (org.olat.ims.qti21.ui.editor.events.AssessmentItemEvent)2 AssessmentTestEvent (org.olat.ims.qti21.ui.editor.events.AssessmentTestEvent)2 AssessmentTestPartEvent (org.olat.ims.qti21.ui.editor.events.AssessmentTestPartEvent)2 DetachFromPoolEvent (org.olat.ims.qti21.ui.editor.events.DetachFromPoolEvent)2 QItemViewEvent (org.olat.modules.qpool.ui.events.QItemViewEvent)2 RubricBlock (uk.ac.ed.ph.jqtiplus.node.content.variable.RubricBlock)2 Ordering (uk.ac.ed.ph.jqtiplus.node.test.Ordering)2 Selection (uk.ac.ed.ph.jqtiplus.node.test.Selection)2