From 64efda84b532ddc1c591ac73114d61cb5803b9ed Mon Sep 17 00:00:00 2001 From: moodler Date: Thu, 28 Nov 2002 02:41:56 +0000 Subject: [PATCH] Fixes to increase the number of options available to limit assignment upload size, and also to limit the list based on PHP limits --- lib/moodlelib.php | 2 ++ mod/assignment/mod.html | 18 +++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index fdb6eb0a1a..b387815342 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -1766,8 +1766,10 @@ function get_real_size($size=0) { return 0; } $scan['MB'] = 1048576; + $scan['Mb'] = 1048576; $scan['M'] = 1048576; $scan['KB'] = 1024; + $scan['Kb'] = 1024; $scan['K'] = 1024; while (list($key) = each($scan)) { diff --git a/mod/assignment/mod.html b/mod/assignment/mod.html index ab6573b31b..d9f54df115 100644 --- a/mod/assignment/mod.html +++ b/mod/assignment/mod.html @@ -75,15 +75,19 @@

:

maxbytes) { - $form->maxbytes = 500000; + $form->maxbytes = get_real_size("500K"); } + ksort($filesize, SORT_NUMERIC); choose_from_menu($filesize, "maxbytes", "$form->maxbytes"); ?> -- 2.39.5