]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15165 "Essay quiz Manual grading "these are no attempts to show" when there are...
authorjamiesensei <jamiesensei>
Thu, 19 Jun 2008 15:24:27 +0000 (15:24 +0000)
committerjamiesensei <jamiesensei>
Thu, 19 Jun 2008 15:24:27 +0000 (15:24 +0000)
Merged from 1.9

mod/quiz/report/grading/report.php

index 6270b209fbf914f24661d40c019fae3f55f8e929..5df665bb170a07d00ea5761183f9f03f578848c7 100644 (file)
@@ -349,11 +349,10 @@ class quiz_report extends quiz_default_report {
         $sort = 'ORDER BY u.firstname, u.lastname, qa.attempt ASC';
 
         if ($gradenextungraded){
-            $limit = ' LIMIT '.QUIZ_REPORT_DEFAULT_GRADING_PAGE_SIZE;
+            $attempts = $DB->get_records_sql($select.$from.$where.$sort, $params, 0, QUIZ_REPORT_DEFAULT_GRADING_PAGE_SIZE);
         } else {
-            $limit = '';
+            $attempts = $DB->get_records_sql($select.$from.$where.$sort, $params);
         }
-        $attempts = $DB->get_records_sql($select.$from.$where.$sort.$limit, $params);
         if ($attempts){
             $firstattempt = current($attempts);
             $fullname = fullname($firstattempt);
@@ -432,7 +431,7 @@ class quiz_report extends quiz_default_report {
         // this sql joins the attempts table and the user table
         $select = 'SELECT qa.id AS attemptid, qa.uniqueid, qa.attempt, qa.timefinish, qa.preview,
                     u.id AS userid, u.firstname, u.lastname, u.picture ';
-        if ($wantstateevent){
+        if ($wantstateevent && $questionid){
             $select .= ', qs.event ';
         }
         $from   = 'FROM {user} u, ' .