-
New Feature
-
Resolution: Duplicate
-
Major
-
None
-
2.7
-
MOODLE_27_STABLE
-
mdl44600-master
-
2.4
DESCRIPTION UP FOR DISCUSSION IN https://moodle.org/mod/forum/discuss.php?d=217532#p996584
When creating an assignment, teachers should have the option to restrict the types of files students may submit. When a student edits their submission, the filepicker should not allow files to be uploaded that do not match the specified filetypes.
The filetype options should be as follows:
Word (*.doc, *.docx, *.rtf) - selected by default
PDF (*.pdf) - selected by default
Image (*.gif, *.jpg, *.jpeg, *.png), *.svg, *.tiff)
Video (*.mp4, *.flv, *.mov, *.avi)
Audio (*.mp3, *.ogg, *.wav, *.aac, *.wma)
Other (text box, type in comma-separated)
The settings should be located within the "submission settings" area.
Note: it may be easier to use Moodle's in-built file_get_typegroup function to retrieve sets of related extensions - for discussion.
Notes on settings:
● the "restrict file types" option should only be enabled if "file submissions" is on
● the file type options (Word, PDF, etc) should only be enabled if "restrict file types" is on
● form validation should ensure the "other" value is in the correct format, eg *.extn (comma-separated list)
● Error message: List should be in the format .doc,.docx
● form validation should ensure that if "restrict file types" if set to "yes", then at least one file type must be checked
● help text should be as follows:
● If Restrict File Types is enabled, you can specify the file formats you will accept for this assignment. Students will not be able to upload files that are not in the format you select.
● If Restrict File Types is set to No, there will be no restriction on the type of files students may submit.
The filepicker element in the edit submission page should restrict the file types based on the assignment settings.
$mform->addElement('filepicker', 'userfile', get_string('file'), null, array('maxbytes' => $maxbytes, 'accepted_types' => '[filetypes]'));
Add acceptable file types information when file type restriction feature is enabled in assignment activities