use of org.olat.modules.qpool.ui.events.QPoolEvent in project OpenOLAT by OpenOLAT.
the class QuestionItemDetailsController method doChangeQuestionStatus.
private void doChangeQuestionStatus(UserRequest ureq, QuestionItem item, QuestionStatus newStatus) {
if (!newStatus.equals(item.getQuestionStatus()) && item instanceof QuestionItemImpl) {
QuestionItemImpl itemImpl = (QuestionItemImpl) item;
QuestionItemAuditLogBuilder builder = qpoolService.createAuditLogBuilder(getIdentity(), Action.STATUS_CHANGED);
builder.withBefore(itemImpl);
builder.withMessage("New status: " + newStatus);
itemImpl.setQuestionStatus(newStatus);
qpoolService.updateItem(itemImpl);
builder.withAfter(item);
qpoolService.persist(builder.create());
fireEvent(ureq, new QPoolEvent(QPoolEvent.ITEM_STATUS_CHANGED, item.getKey()));
}
reloadData(ureq);
}
use of org.olat.modules.qpool.ui.events.QPoolEvent in project OpenOLAT by OpenOLAT.
the class QuestionItemDetailsController method doRate.
private void doRate(UserRequest ureq, float rating, String comment) {
QuestionItem item = metadatasCtrl.getItem();
qpoolService.rateItemInReview(item, getIdentity(), rating, comment);
reloadData(ureq);
setCommentsController(ureq);
fireEvent(ureq, new QPoolEvent(QPoolEvent.ITEM_STATUS_CHANGED, item.getKey()));
}
use of org.olat.modules.qpool.ui.events.QPoolEvent in project OpenOLAT by OpenOLAT.
the class QuestionItemDetailsController method doShareItemsWithGroup.
private void doShareItemsWithGroup(UserRequest ureq, QuestionItemShort item, List<BusinessGroup> groups) {
qpoolService.shareItemsWithGroups(Collections.singletonList(item), groups, false);
fireEvent(ureq, new QPoolEvent(QPoolEvent.ITEM_SHARED));
}
use of org.olat.modules.qpool.ui.events.QPoolEvent in project OpenOLAT by OpenOLAT.
the class QuestionItemDetailsController method doShareItemsWithPool.
private void doShareItemsWithPool(UserRequest ureq, QuestionItemShort item, List<Pool> pools) {
qpoolService.addItemsInPools(Collections.singletonList(item), pools, false);
fireEvent(ureq, new QPoolEvent(QPoolEvent.ITEM_SHARED));
}
use of org.olat.modules.qpool.ui.events.QPoolEvent in project OpenOLAT by OpenOLAT.
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));
}
}
Aggregations