mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 04:52:36 +02:00
Deletin the grader->get_numusers() method. I was doing some not
needed checks (I guess copied from load_users(), where they have sense). Fallback to grade_report->get_numusers(), that looks ok. MDL-13403 Merged from 19_STABLE
This commit is contained in:
parent
eabb4dd694
commit
94519ff59b
@ -339,29 +339,6 @@ class grade_report_grader extends grade_report {
|
||||
return $this->users;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches and returns a count of all the users that will be shown on this page.
|
||||
* @param bool $groups Whether to apply groupsql
|
||||
* @return int Count of users
|
||||
*/
|
||||
function get_numusers($groups=true) {
|
||||
global $CFG;
|
||||
|
||||
$countsql = "SELECT COUNT(DISTINCT u.id)
|
||||
FROM {$CFG->prefix}grade_grades g RIGHT OUTER JOIN
|
||||
{$CFG->prefix}user u ON (u.id = g.userid AND g.itemid = $this->sortitemid)
|
||||
LEFT JOIN {$CFG->prefix}role_assignments ra ON u.id = ra.userid ";
|
||||
if ($groups) {
|
||||
$countsql .= $this->groupsql;
|
||||
}
|
||||
$countsql .= " WHERE ra.roleid in ($this->gradebookroles) ";
|
||||
if ($groups) {
|
||||
$countsql .= $this->groupwheresql;
|
||||
}
|
||||
$countsql .= " AND ra.contextid ".get_related_contexts_string($this->context);
|
||||
return count_records_sql($countsql);
|
||||
}
|
||||
|
||||
/**
|
||||
* we supply the userids in this query, and get all the grades
|
||||
* pulls out all the grades, this does not need to worry about paging
|
||||
|
Loading…
x
Reference in New Issue
Block a user