mirror of
https://github.com/moodle/moodle.git
synced 2025-08-02 23:59:41 +02:00
MDL-15100 gradebook conversion
This commit is contained in:
parent
d907d51a55
commit
ea1e551da6
1 changed files with 4 additions and 4 deletions
|
@ -140,7 +140,7 @@ class grade_report_user extends grade_report {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function fill_table() {
|
public function fill_table() {
|
||||||
global $CFG;
|
global $CFG, $DB;
|
||||||
$numusers = $this->get_numusers(false); // total course users
|
$numusers = $this->get_numusers(false); // total course users
|
||||||
$items =& $this->gseq->items;
|
$items =& $this->gseq->items;
|
||||||
$grades = array();
|
$grades = array();
|
||||||
|
@ -265,9 +265,9 @@ class grade_report_user extends grade_report {
|
||||||
/// find the number of users with a higher grade
|
/// find the number of users with a higher grade
|
||||||
$sql = "SELECT COUNT(DISTINCT(userid))
|
$sql = "SELECT COUNT(DISTINCT(userid))
|
||||||
FROM {grade_grades}
|
FROM {grade_grades}
|
||||||
WHERE finalgrade > {$grade_grade->finalgrade}
|
WHERE finalgrade > ?
|
||||||
AND itemid = {$grade_item->id}";
|
AND itemid = ?";
|
||||||
$rank = count_records_sql($sql) + 1;
|
$rank = $DB->count_records_sql($sql, array($grade_grade->finalgrade, $grade_item->id)) + 1;
|
||||||
|
|
||||||
$data[] = '<span class="'.$hidden.$class.'">'."$rank/$numusers".'</span>';
|
$data[] = '<span class="'.$hidden.$class.'">'."$rank/$numusers".'</span>';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue