Home
Documentation
Downloads
Demo
Tracker
Development
Translation
Moodle.net
Search
projects
/
moodle.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6bf696b
)
MDL-47064 core_grades: fix the calculation of contribution towards total
author
Simey Lameze
<simey@moodle.com>
Mon, 15 Sep 2014 04:19:40 +0000
(12:19 +0800)
committer
Adrian Greeve
<adrian@moodle.com>
Fri, 3 Oct 2014 05:54:39 +0000
(13:54 +0800)
Part of: MDL-46576
grade/report/user/lib.php
patch
|
blob
|
blame
|
history
diff --git
a/grade/report/user/lib.php
b/grade/report/user/lib.php
index
3034db7
..
8718150
100644
(file)
--- a/
grade/report/user/lib.php
+++ b/
grade/report/user/lib.php
@@
-655,7
+655,11
@@
class grade_report_user extends grade_report {
}
}
if ($validpercent) {
- $data['contributiontocoursetotal']['content'] = format_float($percentoftotal * 100.0, 2) . ' %';
+ $grademin = $grade_grade->grade_item->grademin;
+ $grademax = $grade_grade->grade_item->grademax;
+ $finalgrade = $grade_grade->finalgrade;
+ $contribution = format_float(((($finalgrade-$grademin)/($grademax-$grademin)*($percentoftotal * 100.0))),2);
+ $data['contributiontocoursetotal']['content'] = $contribution;
}
}
}