Skip to content

Commit

Permalink
praxisdigital/moodle-opgaver#501 - Skip files larger than 100 MB
Browse files Browse the repository at this point in the history
  • Loading branch information
frederikmillingpytlick committed Oct 30, 2024
1 parent 84d8535 commit bce1aac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 8 additions & 0 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1442,6 +1442,14 @@ function urkund_send_file_to_urkund($plagiarismfile, $plagiarismsettings, $file)
$DB->update_record('plagiarism_urkund_files', $plagiarismfile);
return true;
}

if ($file->get_filesize() > 100 * 1024 ** 2) { // File is larger than 100 MB, marking to large and skipping.
mtrace("URKUND fileid:".$plagiarismfile->id. ' is to large, skipping...');
$plagiarismfile->statuscode = URKUND_STATUSCODE_TOO_LARGE;
$DB->update_record('plagiarism_urkund_files', $plagiarismfile);
return true;
}

mtrace("URKUND fileid:".$plagiarismfile->id. ' sending to URKUND');
if (!empty($plagiarismfile->relateduserid)) {
$useremail = $DB->get_field('user', 'email', array('id' => $plagiarismfile->relateduserid));
Expand Down
7 changes: 4 additions & 3 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2023071900;
/** @var object $plugin */
$plugin->component = 'plagiarism_urkund';
$plugin->version = 2024103000;
$plugin->requires = 2022041900; // Requires 4.0.
$plugin->cron = 0; // Cron function no longer used.
$plugin->component = 'plagiarism_urkund';
$plugin->maturity = MATURITY_STABLE;
$plugin->release = '4.0.3';
$plugin->release = '4.0.4';

0 comments on commit bce1aac

Please sign in to comment.