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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user