Skip to content

Commit

Permalink
wrap PE export in try catch block
Browse files Browse the repository at this point in the history
  • Loading branch information
tobias-lippert committed Sep 14, 2023
1 parent 5c30d51 commit 0ab4554
Showing 1 changed file with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -371,21 +371,18 @@ private List<Path> exportExercises(String notificationTopic, Set<Exercise> exerc
continue;
}

// Export programming exercise
if (exercise instanceof ProgrammingExercise programmingExercise) {
// Download the repositories' template, solution, tests and students' repositories
exportedExercises
.add(programmingExerciseExportService.exportProgrammingExerciseForArchival(programmingExercise, exportErrors, Optional.of(exerciseExportDir), reportData));
continue;
}

// Export the other exercises types

// Export options
var submissionsExportOptions = new SubmissionExportOptionsDTO();
submissionsExportOptions.setExportAllParticipants(true);
try {
if (exercise instanceof FileUploadExercise) {
// Export programming exercise
if (exercise instanceof ProgrammingExercise programmingExercise) {
// Download the repositories' template, solution, tests and students' repositories
exportedExercises.add(
programmingExerciseExportService.exportProgrammingExerciseForArchival(programmingExercise, exportErrors, Optional.of(exerciseExportDir), reportData));
}
// Export the other exercises types
else if (exercise instanceof FileUploadExercise) {
exportedExercises.add(fileUploadExerciseWithSubmissionsExportService.exportFileUploadExerciseWithSubmissions(exercise, submissionsExportOptions,
exerciseExportDir, exportErrors, reportData));
}
Expand Down

0 comments on commit 0ab4554

Please sign in to comment.