mirror of
https://github.com/moodle/moodle.git
synced 2025-03-18 14:40:06 +01:00
Merge branch 'MDL-39167' of git://github.com/timhunt/moodle
This commit is contained in:
commit
dd3b3a81d1
@ -123,6 +123,24 @@ class quiz_access_manager {
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate the data from any form fields added using {@link add_settings_form_fields()}.
|
||||
* @param array $errors the errors found so far.
|
||||
* @param array $data the submitted form data.
|
||||
* @param array $files information about any uploaded files.
|
||||
* @param mod_quiz_mod_form $quizform the quiz form object.
|
||||
* @return array $errors the updated $errors array.
|
||||
*/
|
||||
public static function validate_settings_form_fields(array $errors,
|
||||
array $data, $files, mod_quiz_mod_form $this) {
|
||||
|
||||
foreach (self::get_rule_classes() as $rule) {
|
||||
$errors = $rule::validate_settings_form_fields($errors, $data, $files, $this);
|
||||
}
|
||||
|
||||
return $errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save any submitted settings when the quiz settings form is submitted.
|
||||
*
|
||||
|
@ -256,6 +256,20 @@ abstract class quiz_access_rule_base {
|
||||
// By default do nothing.
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate the data from any form fields added using {@link add_settings_form_fields()}.
|
||||
* @param array $errors the errors found so far.
|
||||
* @param array $data the submitted form data.
|
||||
* @param array $files information about any uploaded files.
|
||||
* @param mod_quiz_mod_form $quizform the quiz form object.
|
||||
* @return array $errors the updated $errors array.
|
||||
*/
|
||||
public static function validate_settings_form_fields(array $errors,
|
||||
array $data, $files, mod_quiz_mod_form $quizform) {
|
||||
|
||||
return $errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array key => lang string any choices to add to the quiz Browser
|
||||
* security settings menu.
|
||||
|
@ -575,6 +575,9 @@ class mod_quiz_mod_form extends moodleform_mod {
|
||||
}
|
||||
}
|
||||
|
||||
// Any other rule plugins.
|
||||
$errors = quiz_access_manager::validate_settings_form_fields($errors, $data, $files, $this);
|
||||
|
||||
return $errors;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user