From: moodler Date: Fri, 12 Sep 2008 07:33:49 +0000 (+0000) Subject: MDL-16474 Modifications to allow definition of 1-point scales X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=b467ee7539bd530e68a47d315ca890c6a417f05c;p=moodle.git MDL-16474 Modifications to allow definition of 1-point scales --- diff --git a/grade/edit/scale/edit_form.php b/grade/edit/scale/edit_form.php index 79902ed178..a54b81682f 100644 --- a/grade/edit/scale/edit_form.php +++ b/grade/edit/scale/edit_form.php @@ -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'); + } } }