MDL-16474 Modifications to allow definition of 1-point scales

This commit is contained in:
moodler 2008-09-12 07:33:49 +00:00
parent 2b9feb5f0e
commit b467ee7539

View 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');
}
}
}