diff --git a/src/main/java/automark/stages/BypassDownloadStage.java b/src/main/java/automark/stages/BypassDownloadStage.java index 2bbc523..91c38fe 100644 --- a/src/main/java/automark/stages/BypassDownloadStage.java +++ b/src/main/java/automark/stages/BypassDownloadStage.java @@ -54,12 +54,11 @@ public static List run(File workingDir, Properties config) throws Us String[] submissionDirs = unzipDir1.list(); if (submissionDirs == null) throw new UserFriendlyException("Failed to list extracted submissions"); - for (int i = 0; i < submissionDirs.length; i++) { - String submissionDirName = submissionDirs[i]; + for (String submissionDirName : submissionDirs) { String[] parts = submissionDirName.split("_"); String name = parts[0]; - String slug = name.toLowerCase().replaceAll("\\s", "_") + "_" + i; + String slug = name.toLowerCase().replaceAll("\\s", "_"); String email = emails.get(name); Submission submission = new Submission(slug, name, email, null); diff --git a/src/main/java/automark/stages/download/MoodleSession.java b/src/main/java/automark/stages/download/MoodleSession.java index 15014fc..d449cea 100644 --- a/src/main/java/automark/stages/download/MoodleSession.java +++ b/src/main/java/automark/stages/download/MoodleSession.java @@ -103,8 +103,7 @@ public List listSubmissions(String assignmentID) throws IOException, String slug = studentName .trim() .toLowerCase() - .replaceAll("\\s", "_") - + "_" + i; + .replaceAll("\\s", "_"); submissions.add(new Submission(slug, studentName, studentEmail, fileUrl)); }