diff --git a/src/main/java/org/olat/course/nodes/IQSELFCourseNode.java b/src/main/java/org/olat/course/nodes/IQSELFCourseNode.java index da475a142a0eb3085fb5d5be081e0b5ffeee81ef..fb078e249dd3a02b6170537ef71f7e836d543ba1 100644 --- a/src/main/java/org/olat/course/nodes/IQSELFCourseNode.java +++ b/src/main/java/org/olat/course/nodes/IQSELFCourseNode.java @@ -260,7 +260,11 @@ public class IQSELFCourseNode extends AbstractAccessableCourseNode implements Se public boolean archiveNodeData(Locale locale, ICourse course, ArchiveOptions options, ZipOutputStream exportStream, String archivePath, String charset) { String repositorySoftKey = (String) getModuleConfiguration().get(IQEditController.CONFIG_KEY_REPOSITORY_SOFTKEY); - RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(repositorySoftKey, true); + RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(repositorySoftKey, false); + if(re == null) { + log.error("Cannot archive course node. Missing repository entry with soft key: ", repositorySoftKey); + return false; + } try { if(ImsQTI21Resource.TYPE_NAME.equals(re.getOlatResource().getResourceableTypeName())) { diff --git a/src/main/java/org/olat/course/nodes/IQSURVCourseNode.java b/src/main/java/org/olat/course/nodes/IQSURVCourseNode.java index 82612535703bbbdf0daa52b3502db9d8fbd455e6..a68bc105b5353a397c47413620428ed6950524d4 100644 --- a/src/main/java/org/olat/course/nodes/IQSURVCourseNode.java +++ b/src/main/java/org/olat/course/nodes/IQSURVCourseNode.java @@ -305,7 +305,11 @@ public class IQSURVCourseNode extends AbstractAccessableCourseNode implements QT ZipOutputStream exportStream, String archivePath, String charset) { QTIExportManager qem = QTIExportManager.getInstance(); String repositorySoftKey = (String) getModuleConfiguration().get(IQEditController.CONFIG_KEY_REPOSITORY_SOFTKEY); - RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(repositorySoftKey, true); + RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(repositorySoftKey, false); + if(re == null) { + log.error("Cannot archive course node. Missing repository entry with soft key: ", repositorySoftKey); + return false; + } QTIExportFormatter qef = new QTIExportFormatterCSVType3(locale, null,"\t", "\"", "\r\n", false); try { diff --git a/src/main/java/org/olat/course/nodes/IQTESTCourseNode.java b/src/main/java/org/olat/course/nodes/IQTESTCourseNode.java index 5caa4b0707b677eaeac9688268bf955401ef386c..7979b05a7d21ae8e667da9edd623619e3f48bd16 100644 --- a/src/main/java/org/olat/course/nodes/IQTESTCourseNode.java +++ b/src/main/java/org/olat/course/nodes/IQTESTCourseNode.java @@ -713,7 +713,12 @@ public class IQTESTCourseNode extends AbstractAccessableCourseNode implements Pe // 1) prepare result export CourseEnvironment courseEnv = course.getCourseEnvironment(); try { - RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(repositorySoftKey, true); + RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(repositorySoftKey, false); + if(re == null) { + log.error("Cannot archive course node. Missing repository entry with soft key: ", repositorySoftKey); + return false; + } + boolean onyx = QTIResourceTypeModule.isOnyxTest(re.getOlatResource()); if (onyx) { return true;