in mod/assign/locallib.php
in the method get_user_grades_for_gradebook()
the function can be fed a $userid of 0 for all users. This SQL will then select all users in the entire system instead of all users associated with just this course assignment.
SELECT u.id as userid
|
, s.timemodified as datesubmitted
|
, g.grade as rawgrade
|
, g.timemodified as dategraded
|
, g.grader as usermodified
|
FROM mdl_user u
|
LEFT JOIN mdl_assign_submission s
|
ON u.id = s.userid and s.assignment = :assignid
|
LEFT JOIN mdl_assign_grades g
|
ON u.id = g.userid and g.assignment = :assignid
|
WHERE u.id != 0
|
As an improvement I get a list of enrolled users in the course and append "AND u.id IN (#,#,#,#,etc...)" after "u.id != 0".
However I think this could be pointless because of the fix from http://tracker.moodle.org/browse/MDL-36061. Once MDL-36061 is merged I don't see how someone could get to get_user_grades_for_gradebook() intentionally with a $userid=0. Which I think would make this an improvement for something that no longer happens.
Any thoughts?
- will be (partly) resolved by
-
MDL-36061 grade_item->refresh_grades doesn't propagate $userid
-
- Closed
-