From ada7af846f16d0fdf02e38f121caef4a4d6cb680 Mon Sep 17 00:00:00 2001 From: jamiesensei Date: Fri, 2 May 2008 14:23:02 +0000 Subject: [PATCH] MDL-14664 "sorting by question mark when viewing detailled mark in overview quiz report not working" Found that the problem ocurred when attempt.id != attempt.uniqueid as the sql was using the wrong field to join the question records. Merged from HEAD --- mod/quiz/report/overview/report.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/quiz/report/overview/report.php b/mod/quiz/report/overview/report.php index a09456c28d5..5fd4fadb414 100644 --- a/mod/quiz/report/overview/report.php +++ b/mod/quiz/report/overview/report.php @@ -372,7 +372,7 @@ class quiz_report extends quiz_default_report { if(!$questionsort) { $qid = intval(substr($sortpart, 1)); $select .= ', grade '; - $from .= ' LEFT JOIN '.$CFG->prefix.'question_sessions qns ON qns.attemptid = qa.id '. + $from .= ' LEFT JOIN '.$CFG->prefix.'question_sessions qns ON qns.attemptid = qa.uniqueid '. 'LEFT JOIN '.$CFG->prefix.'question_states qs ON qs.id = qns.newgraded '; $where .= ' AND (qns.questionid IS NULL OR qns.questionid = '.$qid.')'; $newsort[] = 'grade '.(strpos($sortpart, 'ASC')? 'ASC' : 'DESC');