From 0b8953aec3614177e6e39d0087b355fc83217c07 Mon Sep 17 00:00:00 2001 From: jamiesensei Date: Thu, 19 Jun 2008 15:24:27 +0000 Subject: [PATCH] MDL-15165 "Essay quiz Manual grading "these are no attempts to show" when there are actually attempts" - not resolved. But while reviewing the query I found a LIMIT clause in sql that I've replace with params to the get_records_sql function. Also made the logic in attempt_sql method more robust. Merged from 1.9 --- mod/quiz/report/grading/report.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mod/quiz/report/grading/report.php b/mod/quiz/report/grading/report.php index 6270b209fb..5df665bb17 100644 --- a/mod/quiz/report/grading/report.php +++ b/mod/quiz/report/grading/report.php @@ -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, ' . -- 2.39.5