Browse Source

Coding guideline fix

MOODLE_29_STABLE
Dan Marsden 9 years ago
parent
commit
f6c88bc3b0
  1. 6
      locallib.php

6
locallib.php

@ -227,9 +227,9 @@ function attendance_update_all_users_grades(mod_attendance_structure $attendance
$dbparams = array('id' => -($attendance->grade)); $dbparams = array('id' => -($attendance->grade));
$scale = $DB->get_record('scale', $dbparams); $scale = $DB->get_record('scale', $dbparams);
$scalearray = explode(',', $scale->scale); $scalearray = explode(',', $scale->scale);
$gradebook_maxgrade = count($scalearray); $gradebookmaxgrade = count($scalearray);
} else { } else {
$gradebook_maxgrade = $attendance->grade; $gradebookmaxgrade = $attendance->grade;
} }
foreach ($usergrades as $userid => $existinggrade) { foreach ($usergrades as $userid => $existinggrade) {
if (is_null($existinggrade->grade)) { if (is_null($existinggrade->grade)) {
@ -242,7 +242,7 @@ function attendance_update_all_users_grades(mod_attendance_structure $attendance
$usertakensesscount = attendance_get_user_taken_sessions_count($attendance->id, $course->startdate, $userid, $coursemodule); $usertakensesscount = attendance_get_user_taken_sessions_count($attendance->id, $course->startdate, $userid, $coursemodule);
$usergrade = attendance_get_user_grade($userstatusesstat, $statuses); $usergrade = attendance_get_user_grade($userstatusesstat, $statuses);
$usermaxgrade = attendance_get_user_max_grade($usertakensesscount, $statuses); $usermaxgrade = attendance_get_user_max_grade($usertakensesscount, $statuses);
$grade->rawgrade = attendance_calc_user_grade_fraction($usergrade, $usermaxgrade) * $gradebook_maxgrade; $grade->rawgrade = attendance_calc_user_grade_fraction($usergrade, $usermaxgrade) * $gradebookmaxgrade;
$grades[$userid] = $grade; $grades[$userid] = $grade;
} }

Loading…
Cancel
Save