use of org.olat.ims.qti21.ui.editor.events.AssessmentTestPartEvent in project OpenOLAT by OpenOLAT.
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);
}
use of org.olat.ims.qti21.ui.editor.events.AssessmentTestPartEvent 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);
}
Aggregations