MDL-58919 assignsubmission_file: Add accepted file types default.

New setting "defaultacceptedfiletypes" to define default accepted file
types in File submissions.
This commit is contained in:
David Balch 2017-05-17 17:52:39 +01:00
parent 17fb1d84a2
commit 797a70c0ec
3 changed files with 8 additions and 0 deletions

View File

@ -29,6 +29,7 @@ $string['configmaxbytes'] = 'Maximum file size';
$string['countfiles'] = '{$a} files';
$string['default'] = 'Enabled by default';
$string['default_help'] = 'If set, this submission method will be enabled by default for all new assignments.';
$string['defaultacceptedfiletypes'] = 'Default accepted file types';
$string['enabled'] = 'File submissions';
$string['enabled_help'] = 'If enabled, students are able to upload one or more files as their submission.';
$string['eventassessableuploaded'] = 'A file has been uploaded.';

View File

@ -72,6 +72,9 @@ class assign_submission_file extends assign_submission_plugin {
$defaultmaxfilesubmissions = $this->get_config('maxfilesubmissions');
$defaultmaxsubmissionsizebytes = $this->get_config('maxsubmissionsizebytes');
$defaultfiletypes = (string)$this->get_config('filetypeslist');
if ($defaultfiletypes == '') {
$defaultfiletypes = (string)get_config('assignsubmission_file', 'filetypes');
}
$settings = array();
$options = array();

View File

@ -32,6 +32,10 @@ $settings->add(new admin_setting_configtext('assignsubmission_file/maxfiles',
new lang_string('maxfiles', 'assignsubmission_file'),
new lang_string('maxfiles_help', 'assignsubmission_file'), 20, PARAM_INT));
$settings->add(new admin_setting_configtext('assignsubmission_file/filetypes',
new lang_string('defaultacceptedfiletypes', 'assignsubmission_file'),
new lang_string('acceptedfiletypes_help', 'assignsubmission_file'), '', PARAM_TEXT));
if (isset($CFG->maxbytes)) {
$name = new lang_string('maximumsubmissionsize', 'assignsubmission_file');