Permalink
Browse files

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.
  • Loading branch information...
1 parent 2e4d9a0 commit 1aecaa3d79c64bf59e4d20ffc3c2d767b45676e9 @timhunt timhunt committed Mar 14, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 question/type/edit_question_form.php
@@ -673,7 +673,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');
}

0 comments on commit 1aecaa3

Please sign in to comment.