From 99be33c3173a70b62a5a7f89f86200a6a955aec8 Mon Sep 17 00:00:00 2001 From: srosse <none@none> Date: Fri, 25 Sep 2015 09:05:32 +0200 Subject: [PATCH] OO-1706: allow bulk download of individual tasks with only assignment or submission, rename the directory of the downloaded archive for individual tasks --- .../org/olat/course/nodes/GTACourseNode.java | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/olat/course/nodes/GTACourseNode.java b/src/main/java/org/olat/course/nodes/GTACourseNode.java index b656f66768c..4720e69d359 100644 --- a/src/main/java/org/olat/course/nodes/GTACourseNode.java +++ b/src/main/java/org/olat/course/nodes/GTACourseNode.java @@ -424,9 +424,17 @@ public class GTACourseNode extends AbstractAccessableCourseNode implements Asses @Override public boolean archiveNodeData(Locale locale, ICourse course, ArchiveOptions options, ZipOutputStream exportStream, String charset) { - GTAManager gtaManager = CoreSpringFactory.getImpl(GTAManager.class); + final GTAManager gtaManager = CoreSpringFactory.getImpl(GTAManager.class); + final ModuleConfiguration config = getModuleConfiguration(); + + String prefix; + if(GTAType.group.name().equals(config.getStringValue(GTACourseNode.GTASK_TYPE))) { + prefix = "grouptask_"; + } else { + prefix = "ita_"; + } - String dirName = "grouptask_" + String dirName = prefix + StringHelper.transformDisplayNameToFileSystemName(getShortName()) + "_" + Formatter.formatDatetimeFilesystemSave(new Date(System.currentTimeMillis())); @@ -434,7 +442,6 @@ public class GTACourseNode extends AbstractAccessableCourseNode implements Asses //save assessment datas List<Identity> users = null; - ModuleConfiguration config = getModuleConfiguration(); if(config.getBooleanSafe(GTASK_GRADING)) { users = ScoreAccountingHelper.loadUsers(course.getCourseEnvironment(), options); @@ -777,11 +784,17 @@ public class GTACourseNode extends AbstractAccessableCourseNode implements Asses tools.add(new GTAGroupAssessmentToolController(ureq, wControl, courseEnv, options.getGroup(), this)); } tools.add(new BulkDownloadToolController(ureq, wControl, courseEnv, options, this)); - } else if(GTAType.individual.name().equals(config.getStringValue(GTACourseNode.GTASK_TYPE)) - && (config.getBooleanSafe(GTASK_REVIEW_AND_CORRECTION) - || config.getBooleanSafe(GTASK_GRADING))) { - tools.add(new BulkAssessmentToolController(ureq, wControl, courseEnv, this)); - tools.add(new BulkDownloadToolController(ureq, wControl, courseEnv, options, this)); + } else if(GTAType.individual.name().equals(config.getStringValue(GTACourseNode.GTASK_TYPE))) { + if(config.getBooleanSafe(GTASK_REVIEW_AND_CORRECTION) || config.getBooleanSafe(GTASK_GRADING)){ + tools.add(new BulkAssessmentToolController(ureq, wControl, courseEnv, this)); + } + + if(config.getBooleanSafe(GTASK_ASSIGNMENT) + || config.getBooleanSafe(GTASK_SUBMIT) + || config.getBooleanSafe(GTASK_REVIEW_AND_CORRECTION) + || config.getBooleanSafe(GTASK_REVISION_PERIOD)) { + tools.add(new BulkDownloadToolController(ureq, wControl, courseEnv, options, this)); + } } return tools; } -- GitLab