OK, trying to write about this in the SC made me think, thinking made me

find the solution. No hacks, no replicating the table object, I just tweaked
the table class itself to help us.

I 'll post at SC#187 about this, but the bug is now totally fixed.
This commit is contained in:
defacer
2005-11-13 04:30:50 +00:00
parent 86f6539591
commit 02828119f6
+8 -2
View File
@@ -655,7 +655,6 @@ class assignment_base {
} else {
$currentgroup = false;
}
$limit = ' '.sql_paging_limit($offset+1, 1);
/// Get all teachers and students
if ($currentgroup) {
@@ -669,6 +668,14 @@ class assignment_base {
$sql = 'FROM '.$CFG->prefix.'user u '.
'LEFT JOIN '.$CFG->prefix.'assignment_submissions s ON u.id = s.userid AND s.assignment = '.$this->assignment->id.' '.
'WHERE u.id IN ('.implode(',', array_keys($users)).') ';
require_once($CFG->libdir.'/tablelib.php');
if($sort = flexible_table::get_sql_sort('mod-assignment-submissions')) {
$sort = 'ORDER BY '.$sort.' ';
}
$limit = sql_paging_limit($offset+1, 1);
$nextid = 0;
if (($auser = get_record_sql($select.$sql.$sort.$limit)) !== false) {
$nextid = $auser->id;
@@ -919,7 +926,6 @@ class assignment_base {
$limit = '';
}
$ssort = "$sort";//sorting order to allow replication of SQL statement
///offset used to calculate index of student in that particular query, needed for the pop up to know who's next
$offset = $page * $perpage;