From e7a935aafa6a9a9fe12687dbbfcef76497fae90a Mon Sep 17 00:00:00 2001 From: defacer Date: Thu, 27 Jan 2005 02:26:00 +0000 Subject: [PATCH] This was pulling out all those records and doing absolutely nothing with them. Sanitized the place a bit. --- mod/quiz/index.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mod/quiz/index.php b/mod/quiz/index.php index f749a94672..3f2eb4df36 100644 --- a/mod/quiz/index.php +++ b/mod/quiz/index.php @@ -98,10 +98,9 @@ $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 = "id\">$strviewallanswers ($usercount $strusers)"; } else { $answercount = 0; -- 2.39.5