]> git.mjollnir.org Git - moodle.git/commitdiff
Deletin the grader->get_numusers() method. I was doing some not
authorstronk7 <stronk7>
Fri, 29 Feb 2008 15:14:30 +0000 (15:14 +0000)
committerstronk7 <stronk7>
Fri, 29 Feb 2008 15:14:30 +0000 (15:14 +0000)
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

grade/report/grader/lib.php

index beaa44387becd81f68957e78e2f58aa51401d8c5..de5d91b59dc7586f59c920f848641fd913394859 100644 (file)
@@ -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