Search in sources :

Example 11 with QItemsProcessedEvent

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

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 12 with QItemsProcessedEvent

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

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)

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