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
|
@ -613,7 +613,7 @@ class grade_category extends grade_object {
|
|||
|
||||
$notexisting = array_diff(array_keys($items), array_keys($existingitems));
|
||||
foreach ($notexisting as $itemid) {
|
||||
$gradeitem = $this->grade_item;
|
||||
$gradeitem = $items[$itemid];
|
||||
$gradegrade = new grade_grade(array('itemid' => $itemid,
|
||||
'userid' => $userid,
|
||||
'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
|
||||
*
|
||||
* @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() {
|
||||
return $this->aggregationstatus;
|
||||
|
@ -786,7 +786,7 @@ class grade_grade extends grade_object {
|
|||
if ($grade_grades[$itemid]->is_excluded()) {
|
||||
unset($values[$itemid]);
|
||||
$alteredaggregationstatus[$itemid] = 'excluded';
|
||||
$alteredaggregationweight[$itemid] = 0;
|
||||
$alteredaggregationweight[$itemid] = null;
|
||||
continue;
|
||||
}
|
||||
// The grade min/max may have been altered by hiding.
|
||||
|
@ -806,7 +806,7 @@ class grade_grade extends grade_object {
|
|||
if (is_null($value)) {
|
||||
unset($values[$itemid]);
|
||||
$alteredaggregationstatus[$itemid] = 'novalue';
|
||||
$alteredaggregationweight[$itemid] = 0;
|
||||
$alteredaggregationweight[$itemid] = null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -824,7 +824,7 @@ class grade_grade extends grade_object {
|
|||
$moredropped = array_diff($allvalues, $values);
|
||||
foreach ($moredropped as $drop => $unused) {
|
||||
$alteredaggregationstatus[$drop] = 'dropped';
|
||||
$alteredaggregationweight[$drop] = 0;
|
||||
$alteredaggregationweight[$drop] = null;
|
||||
}
|
||||
|
||||
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
|
||||
* 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.
|
||||
*/
|
||||
function get_aggregation_hint($gradeitem = null) {
|
||||
|
||||
function get_aggregation_hint() {
|
||||
return array('status' => $this->get_aggregationstatus(),
|
||||
'weight' => $this->aggregationweight);
|
||||
'weight' => $this->get_aggregationweight());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue