MDL-83440 assign: let sub-plugins validate the assign settings form

This commit is contained in:
Tim Hunt
2025-02-07 15:29:14 +00:00
parent 139a0ad5f0
commit 132f1b8e2f
4 changed files with 81 additions and 31 deletions
+14
View File
@@ -107,6 +107,20 @@ abstract class assign_plugin {
return;
}
/**
* This method is called when the mod_assign_mod_form is submitted.
*
* It is an opportunity to validate the settings form fields added by {@see get_settings()}.
*
* @param array $data as passed to mod_assign_mod_form::validation().
* @param array $files as passed to mod_assign_mod_form::validation().
* @return array and validation errors that should be displayed.
* This is array_merged with any other validation errors from the form.
*/
public function settings_validation(array $data, array $files): array {
return [];
}
/**
* The assignment subtype is responsible for saving it's own settings as the database table for the
* standard type cannot be modified.