mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
gradebook MDL-19070 Added a guard to protect against a potential error
This commit is contained in:
parent
89e2569b0f
commit
e2a8447777
@ -793,7 +793,12 @@ class grade_edit_tree_column_range extends grade_edit_tree_column {
|
||||
$grademax = format_float($item->grademax, $item->get_decimals());
|
||||
} elseif ($item->gradetype == GRADE_TYPE_SCALE) {
|
||||
$scale = $DB->get_record('scale', array('id' => $item->scaleid));
|
||||
$scale_items = explode(',', $scale->scale);
|
||||
$scale_items = null;
|
||||
if (empty($scale)) { //if the item is using a scale that's been removed
|
||||
$scale_items = array();
|
||||
} else {
|
||||
$scale_items = explode(',', $scale->scale);
|
||||
}
|
||||
$grademax = end($scale_items) . ' (' . count($scale_items) . ')';
|
||||
} elseif ($item->is_external_item()) {
|
||||
$grademax = format_float($item->grademax, $item->get_decimals());
|
||||
|
Loading…
x
Reference in New Issue
Block a user