mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-44288 qtype_calculatedsimple fix validation notice.
The notice happend if you clicked Save changes before Find the wild cards {x..} present in the correct answer formulas.
This commit is contained in:
parent
ec4c8161a4
commit
dfcaa2450c
@ -585,7 +585,12 @@ class qtype_calculatedsimple_edit_form extends qtype_calculated_edit_form {
|
||||
|
||||
public function validation($data, $files) {
|
||||
$errors = parent::validation($data, $files);
|
||||
$numbers = $data['number'];
|
||||
|
||||
if (array_key_exists('number', $data)) {
|
||||
$numbers = $data['number'];
|
||||
} else {
|
||||
$numbers = array();
|
||||
}
|
||||
foreach ($numbers as $key => $number) {
|
||||
if (! is_numeric($number)) {
|
||||
if (stristr($number, ',')) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user