I have found a simple solution to this the results of the Grader Report compared to the Quiz Report can actually differ based on Roles settings . What can cause issues here is a student in the Grader Report can actually be counted twice by function get_avghtml in grade/report/grader/lib.php .
In the code there is a SQL call on line 964 which calculates $ungraded_counts. This value is then used to do the averages based on the formula $mean_count = $totalcount - $ungraded_count; In the SQL query for ungraded_count I discovered a student can be counted twice if ungraded and a memeber of both two separate graded roles. What this can do is to increase the ungraded student count from one to two for any ungraded student belonging to two separate graded roles .
In the actual SQL query $ungraded_counts = get_records_sql($SQL);
on line 980 selects each ungraded student by roles on line 973 which can result in double count when an ungraded student is in both graded roles.
If you look at Grades General Settings on a site experiencing this issue
you will usually find an additional Graded Role which is custom. The solution is to make sure that only student groups are graded and get in the habit of not adding a student to two separate graded roles at the same time.
This may not be the case for every site however; I have found that usually this is the case when averages are not coming out correct in the Grader Report. The site I experienced this issue on was running Moodle 1.9.4 (Build: 20090128). It will most likely be beneficial to change the SQL query on line 973 to make sure ungraded students are not being pulled from two roles thus creating a false student count which will affect overall averages.
I have found a simple solution to this the results of the Grader Report compared to the Quiz Report can actually differ based on Roles settings . What can cause issues here is a student in the Grader Report can actually be counted twice by function get_avghtml in grade/report/grader/lib.php .
In the code there is a SQL call on line 964 which calculates $ungraded_counts. This value is then used to do the averages based on the formula $mean_count = $totalcount - $ungraded_count; In the SQL query for ungraded_count I discovered a student can be counted twice if ungraded and a memeber of both two separate graded roles. What this can do is to increase the ungraded student count from one to two for any ungraded student belonging to two separate graded roles .
In the actual SQL query $ungraded_counts = get_records_sql($SQL);
on line 980 selects each ungraded student by roles on line 973 which can result in double count when an ungraded student is in both graded roles.
If you look at Grades General Settings on a site experiencing this issue
you will usually find an additional Graded Role which is custom. The solution is to make sure that only student groups are graded and get in the habit of not adding a student to two separate graded roles at the same time.
This may not be the case for every site however; I have found that usually this is the case when averages are not coming out correct in the Grader Report. The site I experienced this issue on was running Moodle 1.9.4 (Build: 20090128). It will most likely be beneficial to change the SQL query on line 973 to make sure ungraded students are not being pulled from two roles thus creating a false student count which will affect overall averages.