Skip to content

Commit

Permalink
MDL-48031 gradebook: Fix for bulk updating users in single view.
Browse files Browse the repository at this point in the history
  • Loading branch information
zbdd authored and Damyon Wiese committed Nov 5, 2014
1 parent 8d3c518 commit 5467cc0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions grade/report/singleview/classes/local/screen/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,13 +341,13 @@ public function process($data) {
$userid = $this->item->id;
foreach ($this->items as $gradeitemid => $gradeitem) {
$null = $gradeitem->gradetype == GRADE_TYPE_SCALE ? -1 : '';
$field = "finalgrade_{$gradeitem->id}_{$gradeitemid}";
$field = "finalgrade_{$gradeitem->id}_{$this->itemid}";
if (isset($data->$field)) {
continue;
}

$grade = grade_grade::fetch(array(
'itemid' => $gradeitem->id,
'itemid' => $this->itemid,
'userid' => $userid
));

Expand All @@ -359,7 +359,7 @@ public function process($data) {
if (preg_match('/override_(\d+)_(\d+)/', $varname, $matches)) {
$data->$matches[0] = '1';
}
if (!preg_match('/^finalgrade_(\d+)_/', $varname, $matches)) {
if (!preg_match('/^finalgrade_(\d+)_(\d+)/', $varname, $matches)) {
continue;
}

Expand Down

0 comments on commit 5467cc0

Please sign in to comment.