Search in sources :

Example 6 with QItemsProcessedEvent

use of org.olat.modules.qpool.ui.events.QItemsProcessedEvent in project OpenOLAT by OpenOLAT.

the class CopyConfirmationController method formOK.

@Override
protected void formOK(UserRequest ureq) {
    List<QuestionItem> copyItems = qpoolService.copyItems(getIdentity(), itemsToCopy);
    addToItemsSource(copyItems);
    logAudit(copyItems);
    fireEvent(ureq, new QItemsProcessedEvent(copyItems, itemsToCopy.size()));
}
Also used : QItemsProcessedEvent(org.olat.modules.qpool.ui.events.QItemsProcessedEvent) QuestionItem(org.olat.modules.qpool.QuestionItem)

Example 7 with QItemsProcessedEvent

use of org.olat.modules.qpool.ui.events.QItemsProcessedEvent in project OpenOLAT by OpenOLAT.

the class QuestionItemDetailsController method doPostConvert.

private void doPostConvert(UserRequest ureq, Event event) {
    if (event instanceof QItemsProcessedEvent) {
        QItemsProcessedEvent ipEvent = (QItemsProcessedEvent) event;
        int numberOfCopies = ipEvent.getNumberOfItems();
        int numberOfFails = ipEvent.getNumberOfFails();
        if (numberOfFails == 0) {
            showInfo("convert.item.successful", new String[] { Integer.toString(numberOfCopies) });
            fireEvent(ureq, new QItemEvent("convert-item", ipEvent.getSuccessfullItems().get(0)));
        } else {
            showWarning("convert.item.warning", new String[] { Integer.toString(numberOfFails), Integer.toString(numberOfCopies) });
        }
    }
}
Also used : QItemEvent(org.olat.modules.qpool.ui.events.QItemEvent) QItemsProcessedEvent(org.olat.modules.qpool.ui.events.QItemsProcessedEvent)

Example 8 with QItemsProcessedEvent

use of org.olat.modules.qpool.ui.events.QItemsProcessedEvent in project OpenOLAT by OpenOLAT.

the class QuestionItemDetailsController method doPostCopy.

private void doPostCopy(UserRequest ureq, Event event) {
    if (event instanceof QItemsProcessedEvent) {
        QItemsProcessedEvent ipEvent = (QItemsProcessedEvent) event;
        int numberOfCopies = ipEvent.getNumberOfItems();
        showInfo("item.copied", Integer.toString(numberOfCopies));
        fireEvent(ureq, new QItemEvent("copy-item", ipEvent.getSuccessfullItems().get(0)));
    }
}
Also used : QItemEvent(org.olat.modules.qpool.ui.events.QItemEvent) QItemsProcessedEvent(org.olat.modules.qpool.ui.events.QItemsProcessedEvent)

Example 9 with QItemsProcessedEvent

use of org.olat.modules.qpool.ui.events.QItemsProcessedEvent in project OpenOLAT by OpenOLAT.

the class ConversionConfirmationController method formOK.

@Override
protected void formOK(UserRequest ureq) {
    String format = formatEl.isOneSelected() ? formatEl.getSelectedKey() : null;
    List<QuestionItemShort> itemsToConvert = formatToItems.get(format);
    List<QuestionItem> convertedItems = qpoolService.convertItems(getIdentity(), itemsToConvert, format, getLocale());
    addToItemsSource(convertedItems);
    logAudit(convertedItems);
    fireEvent(ureq, new QItemsProcessedEvent(convertedItems, itemsToConvert.size(), itemsToConvert.size() - convertedItems.size()));
}
Also used : QuestionItemShort(org.olat.modules.qpool.QuestionItemShort) QItemsProcessedEvent(org.olat.modules.qpool.ui.events.QItemsProcessedEvent) QuestionItem(org.olat.modules.qpool.QuestionItem)

Example 10 with QItemsProcessedEvent

use of org.olat.modules.qpool.ui.events.QItemsProcessedEvent in project openolat by klemens.

the class QuestionListController method doPostConvert.

private void doPostConvert(UserRequest ureq, Event event) {
    if (event instanceof QItemsProcessedEvent) {
        QItemsProcessedEvent ipEvent = (QItemsProcessedEvent) event;
        int numberOfCopies = ipEvent.getNumberOfItems();
        int numberOfFails = ipEvent.getNumberOfFails();
        if (numberOfFails == 0) {
            showInfo("convert.item.successful", new String[] { Integer.toString(numberOfCopies) });
        } else {
            showWarning("convert.item.warning", new String[] { Integer.toString(numberOfFails), Integer.toString(numberOfCopies) });
        }
        getItemsTable().reset();
        fireEvent(ureq, new QPoolEvent(QPoolEvent.EDIT));
    }
}
Also used : QPoolEvent(org.olat.modules.qpool.ui.events.QPoolEvent) QItemsProcessedEvent(org.olat.modules.qpool.ui.events.QItemsProcessedEvent)

Aggregations

QItemsProcessedEvent (org.olat.modules.qpool.ui.events.QItemsProcessedEvent)12 QuestionItem (org.olat.modules.qpool.QuestionItem)4 QItemEvent (org.olat.modules.qpool.ui.events.QItemEvent)4 QPoolEvent (org.olat.modules.qpool.ui.events.QPoolEvent)4 QuestionItemShort (org.olat.modules.qpool.QuestionItemShort)2