This was pulling out all those records and doing absolutely nothing
authordefacer <defacer>
Thu, 27 Jan 2005 02:26:00 +0000 (02:26 +0000)
committerdefacer <defacer>
Thu, 27 Jan 2005 02:26:00 +0000 (02:26 +0000)
with them. Sanitized the place a bit.

mod/quiz/index.php

index f749a94672afe8c6526f3f8dc3c3475408bb545c..3f2eb4df36b0249c900a586df75895b950a627ae 100644 (file)
         $closequiz = userdate($quiz->timeclose);
 
         if (isteacher($course->id)) {
-            if ($allanswers = get_records("quiz_grades", "quiz", $quiz->id)) {
-                $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);
+            if ($usercount = count_records('quiz_grades', 'quiz', $quiz->id)) {
+                $attemptcount = count_records_select('quiz_attempts', 'quiz = '.$quiz->id.' AND timefinish > 0');
+                $strviewallanswers  = get_string('viewallanswers', 'quiz', $attemptcount);
                 $gradecol = "<a href=\"report.php?q=$quiz->id\">$strviewallanswers ($usercount $strusers)</a>";
             } else {
                 $answercount = 0;