From 0147d3da533bfe92b70fe965672f8ccd5c664da4 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Thu, 14 Mar 2013 22:11:49 +0000 Subject: [PATCH] MDL-38397 question editing: only validate default mark if present. Most qtypes have that field, but not all. multianswer is an example in core. Also some contrib qtypes. --- question/type/edit_question_form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/question/type/edit_question_form.php b/question/type/edit_question_form.php index a211b31d7ae60..b93e46ae4a558 100644 --- a/question/type/edit_question_form.php +++ b/question/type/edit_question_form.php @@ -656,7 +656,7 @@ public function validation($fromform, $files) { } // Default mark. - if ($fromform['defaultmark'] < 0) { + if (array_key_exists('defaultmark', $fromform) && $fromform['defaultmark'] < 0) { $errors['defaultmark'] = get_string('defaultmarkmustbepositive', 'question'); }