MDL-46887 mod_assign: Enforce module's maxbytes setting at submission.
authorDavid Balch <david.balch@conted.ox.ac.uk>
Tue, 19 Aug 2014 12:29:15 +0000 (13:29 +0100)
committerDavid Balch <david.balch@conted.ox.ac.uk>
Tue, 19 Aug 2014 12:29:15 +0000 (13:29 +0100)
mod/assign/submission/file/locallib.php

index e460e3d..31c7efc 100644 (file)
@@ -131,6 +131,10 @@ class assign_submission_file extends assign_submission_plugin {
                                 'maxfiles'=>$this->get_config('maxfilesubmissions'),
                                 'accepted_types'=>'*',
                                 'return_types'=>FILE_INTERNAL);
+        if ($fileoptions['maxbytes'] == 0) {
+            // Use module default.
+            $fileoptions['maxbytes'] = get_config('assignsubmission_file', 'maxbytes');
+        }
         return $fileoptions;
     }