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
This commit is contained in:
jamiesensei
2008-05-02 14:23:02 +00:00
parent 833b1e0045
commit ada7af846f
+1 -1
View File
@@ -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');