Skip to content

Commit

Permalink
MDL-44288 qtype_calculatedsimple fix validation notice.
Browse files Browse the repository at this point in the history
The notice happend if you clicked Save changes before Find the wild
cards {x..} present in the correct answer formulas.
  • Loading branch information
timhunt committed Feb 20, 2014
1 parent ec4c816 commit dfcaa24
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,12 @@ public function qtype() {

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, ',')) {
Expand Down

0 comments on commit dfcaa24

Please sign in to comment.