diff --git a/src/main/java/org/olat/course/nodes/gta/ui/GTAParticipantController.java b/src/main/java/org/olat/course/nodes/gta/ui/GTAParticipantController.java index 51974e7b7261eb46d5d06d4c0c5f78b33942f33c..aa8d07d540e784a16235af23a0fbc6e9d693afad 100644 --- a/src/main/java/org/olat/course/nodes/gta/ui/GTAParticipantController.java +++ b/src/main/java/org/olat/course/nodes/gta/ui/GTAParticipantController.java @@ -260,11 +260,11 @@ public class GTAParticipantController extends GTAAbstractController implements A File documentsDir; VFSContainer documentsContainer; if(GTAType.group.name().equals(config.getStringValue(GTACourseNode.GTASK_TYPE))) { - documentsDir = gtaManager.getSubmitDirectory(courseEnv, gtaNode, assessedGroup); documentsContainer = gtaManager.getSubmitContainer(courseEnv, gtaNode, assessedGroup); + documentsDir = gtaManager.getSubmitDirectory(courseEnv, gtaNode, assessedGroup); } else { - documentsDir = gtaManager.getSubmitDirectory(courseEnv, gtaNode, getIdentity()); documentsContainer = gtaManager.getSubmitContainer(courseEnv, gtaNode, getIdentity()); + documentsDir = gtaManager.getSubmitDirectory(courseEnv, gtaNode, getIdentity()); } DueDate dueDate = getSubmissionDueDate(task); diff --git a/src/main/java/org/olat/course/nodes/gta/ui/SubmitDocumentsController.java b/src/main/java/org/olat/course/nodes/gta/ui/SubmitDocumentsController.java index 47a734338630333c3b3ef7dbba2cd196361044a4..45bd958a8e62df377aadbeeeb55334f398d24279 100644 --- a/src/main/java/org/olat/course/nodes/gta/ui/SubmitDocumentsController.java +++ b/src/main/java/org/olat/course/nodes/gta/ui/SubmitDocumentsController.java @@ -175,6 +175,9 @@ class SubmitDocumentsController extends FormBasicController { private void updateModel() { File[] documents = documentsDir.listFiles(new SystemFileFilter(true, false)); + if(documents == null) { + documents = new File[0]; + } List<SubmittedSolution> docList = new ArrayList<>(documents.length); for(File document:documents) { String filename = document.getName(); diff --git a/src/main/java/org/olat/modules/qpool/manager/QuestionPoolServiceImpl.java b/src/main/java/org/olat/modules/qpool/manager/QuestionPoolServiceImpl.java index 6ea8c1396e0cef56b5fb5ad26ac927627f9a489c..07e83b08901c1ca2e6ccc21b8a1f0027b913bc78 100644 --- a/src/main/java/org/olat/modules/qpool/manager/QuestionPoolServiceImpl.java +++ b/src/main/java/org/olat/modules/qpool/manager/QuestionPoolServiceImpl.java @@ -389,7 +389,7 @@ public class QuestionPoolServiceImpl implements QPoolService { @Override public Set<ExportFormatOptions> getExportFormatOptions(List<QuestionItemShort> items, Outcome outcome) { return items.stream() - .filter(item -> StringHelper.containsNonWhitespace(item.getFormat())) + .filter(item -> item != null && StringHelper.containsNonWhitespace(item.getFormat())) .map(QuestionItemShort::getFormat) .map(qpoolModule::getQuestionPoolProvider) .map(QPoolSPI::getTestExportFormats) diff --git a/src/main/java/org/olat/modules/qpool/ui/AbstractItemListController.java b/src/main/java/org/olat/modules/qpool/ui/AbstractItemListController.java index d95282c86665f1134bfc51f4838b3ffbd365fb61..b9ea22feeda95b72f637e19ad0d2704aab963519 100644 --- a/src/main/java/org/olat/modules/qpool/ui/AbstractItemListController.java +++ b/src/main/java/org/olat/modules/qpool/ui/AbstractItemListController.java @@ -23,6 +23,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.List; +import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; @@ -369,7 +370,9 @@ public abstract class AbstractItemListController extends FormBasicController public List<QuestionItemShort> getSelectedShortItems() { return getItemsTable().getMultiSelectedIndex().stream() + .filter(index -> getModel().ensureLoaded(index.intValue(), itemsTable)) .map(index -> getModel().getObject(index.intValue())) + .filter(Objects::nonNull) .collect(Collectors.toList()); } diff --git a/src/main/java/org/olat/modules/qpool/ui/QuestionItemDataModel.java b/src/main/java/org/olat/modules/qpool/ui/QuestionItemDataModel.java index ff18faa835f5623ee47d78f20f74f4f6f87b9c5c..7de91532f9ec4b8d01aa8cadba22a743bae6102d 100644 --- a/src/main/java/org/olat/modules/qpool/ui/QuestionItemDataModel.java +++ b/src/main/java/org/olat/modules/qpool/ui/QuestionItemDataModel.java @@ -22,6 +22,7 @@ package org.olat.modules.qpool.ui; import java.text.DecimalFormat; import java.util.List; +import org.olat.core.gui.components.form.flexible.elements.FlexiTableElement; import org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiTableDataSourceModel; import org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel; import org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableDataSourceDelegate; @@ -55,6 +56,14 @@ public class QuestionItemDataModel extends DefaultFlexiTableDataSourceModel<Item return null; } + public boolean ensureLoaded(int row, FlexiTableElement tableEl) { + if(isRowLoaded(row) ) { + return true; + } + tableEl.preloadPageOfObjectIndex(row - 1); + return isRowLoaded(row); + } + @Override public QuestionItemDataModel createCopyWithEmptyList() { return new QuestionItemDataModel(getTableColumnModel(), getSourceDelegate(), translator); diff --git a/src/main/java/org/olat/modules/qpool/ui/wizard/Export_1_TypeStep.java b/src/main/java/org/olat/modules/qpool/ui/wizard/Export_1_TypeStep.java index 7806c7c06cd6eb1d0ffd5201f2178345d24442f8..45cb6a32e77a7230d42a386bc80f4e8426a07698 100644 --- a/src/main/java/org/olat/modules/qpool/ui/wizard/Export_1_TypeStep.java +++ b/src/main/java/org/olat/modules/qpool/ui/wizard/Export_1_TypeStep.java @@ -55,7 +55,6 @@ public class Export_1_TypeStep extends BasicStep { @Override public StepFormController getStepController(UserRequest ureq, WindowControl wControl, StepsRunContext runContext, Form form) { runContext.put("items", items); - ExportTypeController controller = new ExportTypeController(ureq, wControl, form, runContext, items); - return controller; + return new ExportTypeController(ureq, wControl, form, runContext, items); } }