]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16474 Modifications to allow definition of 1-point scales
authormoodler <moodler>
Fri, 12 Sep 2008 07:33:49 +0000 (07:33 +0000)
committermoodler <moodler>
Fri, 12 Sep 2008 07:33:49 +0000 (07:33 +0000)
grade/edit/scale/edit_form.php

index 79902ed178e2a871226919740bdf3d8bc88d0c8b..a54b81682fae59368319b703fad993f42d0e6c32 100644 (file)
@@ -141,9 +141,13 @@ class edit_scale_form extends moodleform {
                 }
             }
 
-            $options = explode(',', $data['scale']);
-            if (count($options) < 2) {
+            if (empty($data['scale'])) {
                 $errors['scale'] = get_string('error');
+            } else {
+                $options = explode(',', $data['scale']);
+                if (count($options) < 1) {   // single-item scales are allowed, see MDL-16474
+                    $errors['scale'] = get_string('error');
+                }
             }
         }