Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@

function report_componentgrades_get_students($courseid) {
global $DB;
return $DB->get_records_sql('SELECT stu.id AS userid, stu.idnumber AS idnumber, stu.firstname, stu.lastname, stu.username AS student
FROM {user} AS stu
return $DB->get_records_sql('SELECT (@id := @id +1) id,stu.id AS userid, stu.idnumber AS idnumber, stu.firstname, stu.lastname, stu.username AS student
FROM (select @id :=0 id) id,
{user} AS stu
JOIN {user_enrolments} ue ON ue.userid = stu.id
JOIN {enrol} enr ON ue.enrolid = enr.id
WHERE enr.courseid = ?
Expand Down Expand Up @@ -113,4 +114,4 @@ function report_componentgrades_add_data($sheet, $students, $gradinginfopos, $me
}
}
}
}
}