]> git.mjollnir.org Git - moodle.git/commitdiff
mod/quiz: remove deprecated sql_paging_limit(), use offset, limit parameters
authormartinlanghoff <martinlanghoff>
Tue, 26 Sep 2006 05:11:05 +0000 (05:11 +0000)
committermartinlanghoff <martinlanghoff>
Tue, 26 Sep 2006 05:11:05 +0000 (05:11 +0000)
mod/quiz/report/grading/report.php
mod/quiz/report/overview/report.php

index 774cc9f9f3ea0128295fb551ce88b3dd8de3c2eb..184f2529ef56135868565f7738ef5c5443ef8410 100644 (file)
@@ -240,14 +240,8 @@ class quiz_report extends quiz_default_report {
         $total  = count_records_sql('SELECT COUNT(DISTINCT('.sql_concat('u.id', '\'#\'', $db->IfNull('qa.attempt', '0')).')) '.$from.$where);
         $table->pagesize(10, $total);
 
-        // this is for getting the correct records for a given page
-        if($table->get_page_start() !== '' && $table->get_page_size() !== '') {
-            $limit = ' '.sql_paging_limit($table->get_page_start(), $table->get_page_size());
-        } else {
-            $limit = '';
-        }
         // get the attempts and process them
-        if ($attempts = get_records_sql($select.$from.$where.$sort.$limit)) {
+        if ($attempts = get_records_sql($select.$from.$where.$sort,$table->get_page_start(), $table->get_page_size())) {
             foreach($attempts as $attempt) {
 
                 $picture = print_user_picture($attempt->userid, $quiz->course, $attempt->picture, false, true);
index bc45b31fe8261bcf18c88d4d43d31160fdbed288..c207d78a6c99b87444b9cf5f401966487490eaa1 100644 (file)
@@ -94,7 +94,6 @@ class quiz_report extends quiz_default_report {
         if ($download) {
             $filename = clean_filename("$course->shortname ".format_string($quiz->name,true));
             $sort = '';
-            $limit = '';
         }
 
         // Define table columns
@@ -339,12 +338,6 @@ class quiz_report extends quiz_default_report {
                 $pagesize = 10;
             }
             $table->pagesize($pagesize, $total);
-
-            if($table->get_page_start() !== '' && $table->get_page_size() !== '') {
-                $limit = ' '.sql_paging_limit($table->get_page_start(), $table->get_page_size());
-            } else {
-                $limit = '';
-            }
         }
 
         // If there is feedback, include it in the query.
@@ -357,7 +350,8 @@ class quiz_report extends quiz_default_report {
 
         // Fetch the attempts
         if (!empty($from)) { // if we're in the site course and displaying no attempts, it makes no sense to do the query.
-            $attempts = get_records_sql($select.$from.$where.$sort.$limit);
+            $attempts = get_records_sql($select.$from.$where.$sort,
+                                        $table->get_page_start(), $table->get_page_size());
         } else {
             $attempts = array();
         }