Search in sources :

Example 21 with QuestionItemView

use of org.olat.modules.qpool.QuestionItemView in project OpenOLAT by OpenOLAT.

the class QuestionItemDetailsController method reloadData.

private void reloadData(UserRequest ureq) {
    Long itemKey = metadatasCtrl.getItem().getKey();
    QuestionItemView itemView = itemSource.getItemWithoutRestrictions(itemKey);
    if (itemView != null) {
        qItemSecurityCallback.setQuestionItemView(itemView);
        initTools();
        setCommentsController(ureq);
        QuestionItem reloadedItem = qpoolService.loadItemById(itemView.getKey());
        metadatasCtrl.setItem(reloadedItem, qItemSecurityCallback);
        reviewActionCtrl.setSecurityCallback(qItemSecurityCallback);
        setQuestionController(ureq, reloadedItem, qItemSecurityCallback);
    }
}
Also used : QuestionItemView(org.olat.modules.qpool.QuestionItemView) QuestionItem(org.olat.modules.qpool.QuestionItem)

Example 22 with QuestionItemView

use of org.olat.modules.qpool.QuestionItemView in project OpenOLAT by OpenOLAT.

the class AbstractItemListController method reload.

@Override
public List<ItemRow> reload(List<ItemRow> rows) {
    List<Long> itemToReload = new ArrayList<>();
    for (ItemRow row : rows) {
        itemToReload.add(row.getKey());
    }
    List<QuestionItemView> reloadedItems = itemsSource.getItems(itemToReload);
    List<ItemRow> reloadedRows = new ArrayList<>(reloadedItems.size());
    List<ResourceLicense> licenses = licenseService.loadLicenses(reloadedItems);
    for (QuestionItemView item : reloadedItems) {
        ItemRow reloadedRow = forgeRow(item, licenses);
        reloadedRows.add(reloadedRow);
    }
    return reloadedRows;
}
Also used : ArrayList(java.util.ArrayList) QuestionItemView(org.olat.modules.qpool.QuestionItemView) ResourceLicense(org.olat.core.commons.services.license.ResourceLicense)

Example 23 with QuestionItemView

use of org.olat.modules.qpool.QuestionItemView in project OpenOLAT by OpenOLAT.

the class ItemListController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (selectLink == source) {
        Set<Integer> selections = getItemsTable().getMultiSelectedIndex();
        if (!selections.isEmpty()) {
            List<QuestionItemView> items = getItemViews(selections);
            fireEvent(ureq, new QItemViewEvent("select-item", items));
        }
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : QItemViewEvent(org.olat.modules.qpool.ui.events.QItemViewEvent) QuestionItemView(org.olat.modules.qpool.QuestionItemView)

Example 24 with QuestionItemView

use of org.olat.modules.qpool.QuestionItemView in project OpenOLAT by OpenOLAT.

the class CollectionOfItemsSource method getItems.

@Override
public List<QuestionItemView> getItems(Collection<Long> key) {
    SearchQuestionItemParams params = new SearchQuestionItemParams(identity, roles);
    params.setItemKeys(key);
    if (StringHelper.containsNonWhitespace(restrictToFormat)) {
        params.setFormat(restrictToFormat);
    }
    ResultInfos<QuestionItemView> items = qpoolService.getItemsOfCollection(collection, params, 0, -1);
    return items.getObjects();
}
Also used : SearchQuestionItemParams(org.olat.modules.qpool.model.SearchQuestionItemParams) QuestionItemView(org.olat.modules.qpool.QuestionItemView)

Example 25 with QuestionItemView

use of org.olat.modules.qpool.QuestionItemView in project OpenOLAT by OpenOLAT.

the class SharedItemsSource method getItems.

@Override
public List<QuestionItemView> getItems(Collection<Long> keys) {
    SearchQuestionItemParams params = new SearchQuestionItemParams(identity, roles);
    params.setItemKeys(keys);
    if (StringHelper.containsNonWhitespace(restrictToFormat)) {
        params.setFormat(restrictToFormat);
    }
    ResultInfos<QuestionItemView> items = qpoolService.getSharedItemByResource(group.getResource(), params, 0, -1);
    return items.getObjects();
}
Also used : SearchQuestionItemParams(org.olat.modules.qpool.model.SearchQuestionItemParams) QuestionItemView(org.olat.modules.qpool.QuestionItemView)

Aggregations

QuestionItemView (org.olat.modules.qpool.QuestionItemView)118 Test (org.junit.Test)78 QuestionItem (org.olat.modules.qpool.QuestionItem)76 Identity (org.olat.core.id.Identity)72 SearchQuestionItemParams (org.olat.modules.qpool.model.SearchQuestionItemParams)62 ArrayList (java.util.ArrayList)34 QItemType (org.olat.modules.qpool.model.QItemType)18 BusinessGroup (org.olat.group.BusinessGroup)16 QuestionItemImpl (org.olat.modules.qpool.model.QuestionItemImpl)14 ItemWrapper (org.olat.modules.qpool.model.ItemWrapper)12 QItemViewEvent (org.olat.modules.qpool.ui.events.QItemViewEvent)12 SortKey (org.olat.core.commons.persistence.SortKey)10 MarkImpl (org.olat.core.commons.services.mark.impl.MarkImpl)10 Pool (org.olat.modules.qpool.Pool)10 QuestionItemCollection (org.olat.modules.qpool.QuestionItemCollection)10 Taxonomy (org.olat.modules.taxonomy.Taxonomy)8 TaxonomyLevel (org.olat.modules.taxonomy.TaxonomyLevel)8 SecurityGroupMembershipImpl (org.olat.basesecurity.SecurityGroupMembershipImpl)6 QuestionItemShort (org.olat.modules.qpool.QuestionItemShort)6 OLATResource (org.olat.resource.OLATResource)6