]> git.mjollnir.org Git - moodle.git/commitdiff
Some fixes for displaying empty grades in quizzes
authormoodler <moodler>
Sun, 18 Jan 2004 06:17:02 +0000 (06:17 +0000)
committermoodler <moodler>
Sun, 18 Jan 2004 06:17:02 +0000 (06:17 +0000)
suggested by Marilyn Fleming http://moodle.org/mod/forum/discuss.php?d=4636

mod/quiz/index.php
mod/quiz/lib.php

index 6d07ebbd3954a51dd2fb983d3632379d8b306578..80f9558e6d807675578e6ea064d4a48144dc8352 100644 (file)
                 $gradecol = "";
             }
         } else { 
-            $gradecol = "$bestgrade / $quiz->grade";
+            if ($bestgrade === "" or $quiz->grade == 0) {
+                $gradecol = "";
+            } else {
+                $gradecol = "$bestgrade / $quiz->grade";
+            }
         }
 
         if ($course->format == "weeks" or $course->format == "topics") {
index 55cdece1d655a32d09bece8f12eeccbfcb47a501..3f42296d5a57020c0a8d11424159fc7e4f13ec15 100644 (file)
@@ -1426,7 +1426,7 @@ function quiz_get_user_attempts_string($quiz, $attempts, $bestgrade) {
 function quiz_get_best_grade($quizid, $userid) {
 /// Get the best current grade for a particular user in a quiz
     if (!$grade = get_record("quiz_grades", "quiz", $quizid, "userid", $userid)) {
-        return 0;
+        return "";
     }
 
     return (round($grade->grade,0));