]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-12675 - Give teachers a direct link from the quiz index page to the results.
authortjhunt <tjhunt>
Thu, 20 Dec 2007 15:11:03 +0000 (15:11 +0000)
committertjhunt <tjhunt>
Thu, 20 Dec 2007 15:11:03 +0000 (15:11 +0000)
mod/quiz/index.php

index 074764c7e2cefb832b6a6836e33d3246b86527f9..c131f6dad3a16f8c4b3e8c3e3e8e946049642859 100644 (file)
         if ($showing == 'stats') {
             // The $quiz objects returned by get_all_instances_in_course have the necessary $cm 
             // fields set to make the following call work.
-            $data[] = quiz_num_attempt_summary($quiz, $quiz);
+            $attemptcount = quiz_num_attempt_summary($quiz, $quiz);
+            if ($attemptcount) {
+                $data[] = "<a$class href=\"report.php?id=$quiz->coursemodule\">$attemptcount</a>";
+            } else {
+                $data[] = '';
+            }
         } else if ($showing = 'scores') {
 
             // Grade and feedback.