]> git.mjollnir.org Git - moodle.git/commitdiff
Better info about quizzes
authormoodler <moodler>
Mon, 29 Dec 2003 09:28:14 +0000 (09:28 +0000)
committermoodler <moodler>
Mon, 29 Dec 2003 09:28:14 +0000 (09:28 +0000)
mod/quiz/index.php

index 8c4522091371fe5699fb32fd519b912a396da644..6d07ebbd3954a51dd2fb983d3632379d8b306578 100644 (file)
@@ -53,6 +53,7 @@
     $strbestgrade  = get_string("bestgrade", "quiz");
     $strquizcloses = get_string("quizcloses", "quiz");
     $strattempts = get_string("attempts", "quiz");
+    $strusers  = get_string("users");
 
     if (isteacher($course->id)) {
         $gradecol = $strattempts;
 
         if (isteacher($course->id)) {
             if ($allanswers = get_records("quiz_grades", "quiz", $quiz->id)) {
-                $answercount = count($allanswers);
-                $gradecol = "<a href=\"report.php?id=$quiz->coursemodule\">" .
-                            get_string("viewallanswers","quiz",$answercount)."</a>";
+                $attemptcount = count_records_select("quiz_attempts", "quiz = '$quiz->id' AND timefinish > 0");
+                $usercount = count_records("quiz_grades", "quiz", "$quiz->id");
+                $strviewallanswers  = get_string("viewallanswers","quiz",$attemptcount);
+                $gradecol = "<a href=\"report.php?q=$quiz->id\">$strviewallanswers ($usercount $strusers)</a>";
             } else {
                 $answercount = 0;
                 $gradecol = "";