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.
This commit is contained in:
Tim Hunt
2013-03-14 22:13:44 +00:00
parent a812924762
commit 3d8c5cb044
+1 -1
View File
@@ -656,7 +656,7 @@ abstract class question_edit_form extends question_wizard_form {
}
// Default mark.
if ($fromform['defaultmark'] < 0) {
if (array_key_exists('defaultmark', $fromform) && $fromform['defaultmark'] < 0) {
$errors['defaultmark'] = get_string('defaultmarkmustbepositive', 'question');
}