]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-5799 - quiz previews were sometimes showing up in the quiz overview report. Merge...
authortjhunt <tjhunt>
Thu, 12 Apr 2007 20:11:27 +0000 (20:11 +0000)
committertjhunt <tjhunt>
Thu, 12 Apr 2007 20:11:27 +0000 (20:11 +0000)
mod/quiz/report/overview/report.php

index a8a7268276d356d18b623b39033172efc06d51ca..56495957c37ab319139e75a67a35458d912f2056 100644 (file)
@@ -345,7 +345,7 @@ class quiz_report extends quiz_default_report {
                 // We don't care about group, and we to do something funky with attempts
                 // So do a left join on attempts
                 $from  = 'FROM '.$CFG->prefix.'user u JOIN '.$CFG->prefix.'role_assignments ra ON ra.userid = u.id LEFT JOIN '.$CFG->prefix.'quiz_attempts qa ON u.id = qa.userid AND qa.quiz = '.$quiz->id;
-                $where = " WHERE ra.contextid $contextlists";
+                $where = " WHERE ra.contextid $contextlists AND qa.preview = 0";
                 if (empty($noattempts)) {
                     $where .= ' AND qa.userid IS NOT NULL'; // show ONLY students with attempts;
                 } else if ($noattempts == 1) {