mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
Merge branch 'MDL-48711-master' of git://github.com/merrill-oakland/moodle
This commit is contained in:
commit
ec96b4b3d9
1 changed files with 16 additions and 3 deletions
|
@ -745,7 +745,7 @@ class grade_edit_tree_column_range extends grade_edit_tree_column {
|
||||||
|
|
||||||
// If the parent aggregation is Natural, we should show the number, even for scales, as that value is used...
|
// If the parent aggregation is Natural, we should show the number, even for scales, as that value is used...
|
||||||
// ...in the computation. For text grades, the grademax is not used, so we can still show the no value string.
|
// ...in the computation. For text grades, the grademax is not used, so we can still show the no value string.
|
||||||
$parent_cat = $item->get_parent_category();
|
$parentcat = $item->get_parent_category();
|
||||||
if ($item->gradetype == GRADE_TYPE_TEXT) {
|
if ($item->gradetype == GRADE_TYPE_TEXT) {
|
||||||
$grademax = ' - ';
|
$grademax = ' - ';
|
||||||
} else if ($item->gradetype == GRADE_TYPE_SCALE) {
|
} else if ($item->gradetype == GRADE_TYPE_SCALE) {
|
||||||
|
@ -756,7 +756,7 @@ class grade_edit_tree_column_range extends grade_edit_tree_column {
|
||||||
} else {
|
} else {
|
||||||
$scale_items = explode(',', $scale->scale);
|
$scale_items = explode(',', $scale->scale);
|
||||||
}
|
}
|
||||||
if ($parent_cat->aggregation == GRADE_AGGREGATE_SUM) {
|
if ($parentcat->aggregation == GRADE_AGGREGATE_SUM) {
|
||||||
$grademax = end($scale_items) . ' (' .
|
$grademax = end($scale_items) . ' (' .
|
||||||
format_float($item->grademax, $item->get_decimals()) . ')';
|
format_float($item->grademax, $item->get_decimals()) . ')';
|
||||||
} else {
|
} else {
|
||||||
|
@ -766,7 +766,20 @@ class grade_edit_tree_column_range extends grade_edit_tree_column {
|
||||||
$grademax = format_float($item->grademax, $item->get_decimals());
|
$grademax = format_float($item->grademax, $item->get_decimals());
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($item->aggregationcoef > 0 && $parent_cat->is_extracredit_used()) {
|
$isextracredit = false;
|
||||||
|
if ($item->aggregationcoef > 0) {
|
||||||
|
// For category grade items, we need the grandparent category.
|
||||||
|
// The parent is just category the grade item represents.
|
||||||
|
if ($item->is_category_item()) {
|
||||||
|
$grandparentcat = $parentcat->get_parent_category();
|
||||||
|
if ($grandparentcat->is_extracredit_used()) {
|
||||||
|
$isextracredit = true;
|
||||||
|
}
|
||||||
|
} else if ($parentcat->is_extracredit_used()) {
|
||||||
|
$isextracredit = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($isextracredit) {
|
||||||
$grademax .= ' ' . html_writer::tag('abbr', get_string('aggregationcoefextrasumabbr', 'grades'),
|
$grademax .= ' ' . html_writer::tag('abbr', get_string('aggregationcoefextrasumabbr', 'grades'),
|
||||||
array('title' => get_string('aggregationcoefextrasum', 'grades')));
|
array('title' => get_string('aggregationcoefextrasum', 'grades')));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue