diff --git a/mod/assignment/type/upload/upload_form.php b/mod/assignment/type/upload/upload_form.php index ecfa5d3bc6d..df12a016764 100644 --- a/mod/assignment/type/upload/upload_form.php +++ b/mod/assignment/type/upload/upload_form.php @@ -28,6 +28,7 @@ class mod_assignment_upload_form extends moodleform { // visible elements $mform->addElement('filemanager', 'files_filemanager', get_string('uploadafile'), null, $instance['options']); + $mform->addRule('files_filemanager', get_string('uploadnofilefound'), 'required', null, 'client'); // hidden params $mform->addElement('hidden', 'contextid', $instance['contextid']); diff --git a/mod/assignment/type/uploadsingle/upload_form.php b/mod/assignment/type/uploadsingle/upload_form.php index 0a79a85b58b..1edb37e6f06 100644 --- a/mod/assignment/type/uploadsingle/upload_form.php +++ b/mod/assignment/type/uploadsingle/upload_form.php @@ -30,6 +30,7 @@ class mod_assignment_uploadsingle_form extends moodleform { //$mform->addElement('filemanager', 'newfile', get_string('uploadafile')); //$mform->addElement('filemanager', 'files_filemanager', get_string('uploadafile'), null, $instance['options']); $mform->addElement('filepicker', 'assignment_file', get_string('uploadafile'), null, $instance['options']); + $mform->addRule('assignment_file', get_string('uploadnofilefound'), 'required', null, 'client'); // hidden params $mform->addElement('hidden', 'contextid', $instance['contextid']);