Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 1aecaa3d79c64bf59e4d20ffc3c2d767b45676e9 1 parent 2e4d9a0
Tim Hunt authored

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  question/type/edit_question_form.php
2  question/type/edit_question_form.php
@@ -673,7 +673,7 @@ public function validation($fromform, $files) {
673 673
         }
674 674
 
675 675
         // Default mark.
676  
-        if ($fromform['defaultmark'] < 0) {
  676
+        if (array_key_exists('defaultmark', $fromform) && $fromform['defaultmark'] < 0) {
677 677
             $errors['defaultmark'] = get_string('defaultmarkmustbepositive', 'question');
678 678
         }
679 679
 

0 notes on commit 1aecaa3

Please sign in to comment.
Something went wrong with that request. Please try again.