mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-47064 Grades: Final fix - set the grademax from the item, not the cat
Part of: MDL-46576
This commit is contained in:
parent
ee07a54be0
commit
6077a4d43b
3 changed files with 8 additions and 10 deletions
|
@ -461,7 +461,7 @@ class grade_report_user extends grade_report {
|
||||||
|
|
||||||
/// Actual Grade
|
/// Actual Grade
|
||||||
$gradeval = $grade_grade->finalgrade;
|
$gradeval = $grade_grade->finalgrade;
|
||||||
$hint = $grade_grade->get_aggregation_hint($grade_object);
|
$hint = $grade_grade->get_aggregation_hint();
|
||||||
if (!$this->canviewhidden) {
|
if (!$this->canviewhidden) {
|
||||||
/// Virtual Grade (may be calculated excluding hidden items etc).
|
/// Virtual Grade (may be calculated excluding hidden items etc).
|
||||||
$adjustedgrade = $this->blank_hidden_total_and_adjust_bounds($this->courseid,
|
$adjustedgrade = $this->blank_hidden_total_and_adjust_bounds($this->courseid,
|
||||||
|
|
|
@ -613,7 +613,7 @@ class grade_category extends grade_object {
|
||||||
|
|
||||||
$notexisting = array_diff(array_keys($items), array_keys($existingitems));
|
$notexisting = array_diff(array_keys($items), array_keys($existingitems));
|
||||||
foreach ($notexisting as $itemid) {
|
foreach ($notexisting as $itemid) {
|
||||||
$gradeitem = $this->grade_item;
|
$gradeitem = $items[$itemid];
|
||||||
$gradegrade = new grade_grade(array('itemid' => $itemid,
|
$gradegrade = new grade_grade(array('itemid' => $itemid,
|
||||||
'userid' => $userid,
|
'userid' => $userid,
|
||||||
'rawgrademin' => $gradeitem->grademin,
|
'rawgrademin' => $gradeitem->grademin,
|
||||||
|
|
|
@ -320,7 +320,7 @@ class grade_grade extends grade_object {
|
||||||
/**
|
/**
|
||||||
* Returns the info on how this value was used in the aggregated grade
|
* Returns the info on how this value was used in the aggregated grade
|
||||||
*
|
*
|
||||||
* @return string One of 'dropped', 'excluded', 'novalue' or a specific weighting
|
* @return string One of 'dropped', 'excluded', 'novalue', 'used' or 'extra'
|
||||||
*/
|
*/
|
||||||
public function get_aggregationstatus() {
|
public function get_aggregationstatus() {
|
||||||
return $this->aggregationstatus;
|
return $this->aggregationstatus;
|
||||||
|
@ -786,7 +786,7 @@ class grade_grade extends grade_object {
|
||||||
if ($grade_grades[$itemid]->is_excluded()) {
|
if ($grade_grades[$itemid]->is_excluded()) {
|
||||||
unset($values[$itemid]);
|
unset($values[$itemid]);
|
||||||
$alteredaggregationstatus[$itemid] = 'excluded';
|
$alteredaggregationstatus[$itemid] = 'excluded';
|
||||||
$alteredaggregationweight[$itemid] = 0;
|
$alteredaggregationweight[$itemid] = null;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// The grade min/max may have been altered by hiding.
|
// The grade min/max may have been altered by hiding.
|
||||||
|
@ -806,7 +806,7 @@ class grade_grade extends grade_object {
|
||||||
if (is_null($value)) {
|
if (is_null($value)) {
|
||||||
unset($values[$itemid]);
|
unset($values[$itemid]);
|
||||||
$alteredaggregationstatus[$itemid] = 'novalue';
|
$alteredaggregationstatus[$itemid] = 'novalue';
|
||||||
$alteredaggregationweight[$itemid] = 0;
|
$alteredaggregationweight[$itemid] = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -824,7 +824,7 @@ class grade_grade extends grade_object {
|
||||||
$moredropped = array_diff($allvalues, $values);
|
$moredropped = array_diff($allvalues, $values);
|
||||||
foreach ($moredropped as $drop => $unused) {
|
foreach ($moredropped as $drop => $unused) {
|
||||||
$alteredaggregationstatus[$drop] = 'dropped';
|
$alteredaggregationstatus[$drop] = 'dropped';
|
||||||
$alteredaggregationweight[$drop] = 0;
|
$alteredaggregationweight[$drop] = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($values as $itemid => $val) {
|
foreach ($values as $itemid => $val) {
|
||||||
|
@ -1019,12 +1019,10 @@ class grade_grade extends grade_object {
|
||||||
* for the grade_category. For example this could be an extra credit item, and it could be
|
* for the grade_category. For example this could be an extra credit item, and it could be
|
||||||
* dropped because it's in the X lowest or highest.
|
* dropped because it's in the X lowest or highest.
|
||||||
*
|
*
|
||||||
* @param grade_item $gradeitem An optional grade_item, saves having to load the grade_grade's grade_item
|
|
||||||
* @return array(status, weight) - A keyword and a numerical weight that represents how this grade was included in the aggregation.
|
* @return array(status, weight) - A keyword and a numerical weight that represents how this grade was included in the aggregation.
|
||||||
*/
|
*/
|
||||||
function get_aggregation_hint($gradeitem = null) {
|
function get_aggregation_hint() {
|
||||||
|
|
||||||
return array('status' => $this->get_aggregationstatus(),
|
return array('status' => $this->get_aggregationstatus(),
|
||||||
'weight' => $this->aggregationweight);
|
'weight' => $this->get_aggregationweight());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue