Skip to content
Snippets Groups Projects
Commit 28b0d86f authored by srosse's avatar srosse
Browse files

OO-4649: don't archive test if the test entry is already deleted

Don't archive test in a course element if the test entry is already
deleted, same for survey and self test
parent fd8db278
No related branches found
No related tags found
No related merge requests found
......@@ -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())) {
......
......@@ -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 {
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment