Skip to content

Commit

Permalink
MDL-38397 question editing: only validate default mark if present.
Browse files Browse the repository at this point in the history
Most qtypes have that field, but not all. multianswer is an example in core.
Also some contrib qtypes.
  • Loading branch information
timhunt committed Mar 14, 2013
1 parent a812924 commit 3d8c5cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion question/type/edit_question_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down

0 comments on commit 3d8c5cb

Please sign in to comment.