MDL-14840 trimming scale options - the spaces should not be there in the first place (to be addressed later MDL-16832) - credit goes to Mike Corb and Dan Marsden

This commit is contained in:
skodak
2008-10-08 18:52:46 +00:00
parent 821c604e82
commit ebbc87af56
+1
View File
@@ -379,6 +379,7 @@ if ($formdata = $mform->get_data()) {
} else {
$scale = $gradeitem->load_scale();
$scales = explode(',', $scale->scale);
$scales = array_map('trim', $scales); //hack - trim whitespace around scale options
array_unshift($scales, '-'); // scales start at key 1
$key = array_search($value, $scales);
if ($key === false) {