]> git.mjollnir.org Git - moodle.git/commitdiff
Bug #5416 - sorting by question column in overview report plugin broken - please...
authorskodak <skodak>
Thu, 25 May 2006 10:00:06 +0000 (10:00 +0000)
committerskodak <skodak>
Thu, 25 May 2006 10:00:06 +0000 (10:00 +0000)
mod/quiz/report/overview/report.php

index 98f7eebe6c505bfe340e35d5ab2f29d9fc542609..a6fe18ed2730af8097b025f8e9e02528edcc80c3 100644 (file)
@@ -308,7 +308,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.attemptuniqueid '.
+                            $from        .= ' LEFT JOIN '.$CFG->prefix.'question_sessions qns ON qns.attemptid = qa.id '.
                                                 'LEFT JOIN '.$CFG->prefix.'question_states qs ON qs.id = qns.newgraded ';
                             $where       .= ' AND ('.sql_isnull('qns.questionid').' OR qns.questionid = '.$qid.')';
                             $newsort[]    = 'grade '.(strpos($sortpart, 'ASC')? 'ASC' : 'DESC');