diff --git a/classes/combinator_grader_outcome.php b/classes/combinator_grader_outcome.php index 567a67f8..9348e00f 100644 --- a/classes/combinator_grader_outcome.php +++ b/classes/combinator_grader_outcome.php @@ -120,23 +120,10 @@ private function save_files($files) { 'filepath' => '/', // File path within the context. 'filename' => $extendedfilename, ]; - // Get the file storage object. + + // Create the file in Moodle's filesystem. $fs = get_file_storage(); - - // Check if the file already exists to avoid duplicates. - if ( - !$fs->file_exists( - $contextid, - $fileinfo['component'], - $fileinfo['filearea'], - $fileinfo['itemid'], - $fileinfo['filepath'], - $fileinfo['filename'] - ) - ) { - // Create the file in Moodle's filesystem. - $file = $fs->create_file_from_string($fileinfo, $decoded); - } + $file = $fs->create_file_from_string($fileinfo, $decoded); // Generate a URL to the saved file. $url = '@@PLUGINFILE@@/' . $extendedfilename;