Permalink
Browse files

Merging all my latest changes and fixes from HEAD related to SC#187.

  • Loading branch information...
1 parent a945eab commit 2ac8f379c3db9990b62fd0b53b3cc20af7e5c941 defacer committed Nov 13, 2005
Showing with 9 additions and 9 deletions.
  1. +9 −9 mod/assignment/lib.php
View
@@ -655,7 +655,6 @@ function display_submission() {
} else {
$currentgroup = false;
}
- $limit = ' '.sql_paging_limit($offset+1, 1);
/// Get all teachers and students
if ($currentgroup) {
@@ -669,6 +668,14 @@ function display_submission() {
$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;
@@ -900,13 +907,7 @@ function display_submissions() {
}
if ($sort = $table->get_sql_sort()) {
- $sortparts = explode(',', $sort);
- $newsort = array();
- foreach ($sortparts as $sortpart) {
- $sortpart = trim($sortpart);
- $newsort[] = $sortpart;
- }
- $sort = ' ORDER BY '.implode(', ', $newsort);
+ $sort = ' ORDER BY '.$sort;
}
$select = 'SELECT u.id, u.id, u.firstname, u.lastname, u.picture, s.id AS submissionid, s.grade, s.comment, s.timemodified, s.timemarked, ((s.timemarked > 0) AND (s.timemarked >= s.timemodified)) AS status ';
@@ -923,7 +924,6 @@ function display_submissions() {
$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;

0 comments on commit 2ac8f37

Please sign in to comment.