]> git.mjollnir.org Git - moodle.git/commitdiff
All grades are hidden now when zero grade is chosen ... even the marks.
authormoodler <moodler>
Wed, 10 Sep 2003 08:22:16 +0000 (08:22 +0000)
committermoodler <moodler>
Wed, 10 Sep 2003 08:22:16 +0000 (08:22 +0000)
This mode is only really useful when feedback is turned on.

mod/quiz/attempt.php
mod/quiz/lib.php
mod/quiz/mod.html
mod/quiz/review.php

index e417df9d4a6a70c8277199533eb744de4e779656..e1567ea1548673de9a6d01f0ab47fadad8e78a85 100644 (file)
         $strgrade = get_string("grade");
         $strscore = get_string("score", "quiz");
 
-        print_heading("$strscore: $result->sumgrades/$quiz->sumgrades ($result->percentage %)");
         if ($quiz->grade) {
+            print_heading("$strscore: $result->sumgrades/$quiz->sumgrades ($result->percentage %)");
             print_heading("$strgrade: $result->grade/$quiz->grade");
         }
 
index 5f6b129e75f1fea3ff45f75465d49f85fc7ff7a0..96d9a85227c6f1569320a686197a3e0fb35330bf 100644 (file)
@@ -444,7 +444,7 @@ function quiz_print_question_icon($question, $editlink=true) {
 
 function quiz_print_question($number, $question, $grade, $courseid, 
                              $feedback=NULL, $response=NULL, $actualgrade=NULL, $correct=NULL,
-                             $realquestion=NULL, $shuffleanswers=false) {
+                             $realquestion=NULL, $shuffleanswers=false, $showgrades=true) {
 
 /// Prints a quiz question, any format
 /// $question is provided as an object
@@ -477,10 +477,12 @@ function quiz_print_question($number, $question, $grade, $courseid,
     echo "<table width=100% cellspacing=10>";
     echo "<tr><td nowrap width=100 valign=top>";
     echo "<p align=center><b>$number</b></p>";
-    if ($feedback or $response) {
-        echo "<p align=center><font size=1>$strmarks: $actualgrade/$grade</font></p>";
-    } else {
-        echo "<p align=center><font size=1>$grade $strmarks</font></p>";
+    if ($showgrades) {
+        if ($feedback or $response) {
+            echo "<p align=center><font size=1>$strmarks: $actualgrade/$grade</font></p>";
+        } else {
+            echo "<p align=center><font size=1>$grade $strmarks</font></p>";
+        }
     }
     print_spacer(1,100);
     
@@ -991,7 +993,7 @@ function quiz_print_quiz_questions($quiz, $results=NULL, $questions=NULL, $shuff
         print_simple_box_start("CENTER", "90%");
         quiz_print_question($count, $question, $grades[$question->id]->grade, $quiz->course, 
                             $feedback, $response, $actualgrades, $correct, 
-                            $randomquestion, $quiz->shuffleanswers);
+                            $randomquestion, $quiz->shuffleanswers, $quiz->grade);
         print_simple_box_end();
         echo "<br \>";
     }
index e1f102d70e51f960caf48a11e4713a1e17950773..0f5df5bcc4c1d7e468418041789ca403069211a3 100644 (file)
     <td align=right><p><b><?php print_string("maximumgrade") ?>:</b></p></td>
     <td>
     <?php
-        for ($i=100; $i>=0; $i--) {
+        for ($i=100; $i>=1; $i--) {
             $grades[$i] = $i;
         }
+        $grades[0] = get_string("nograde");
+
         choose_from_menu($grades, "grade", "$form->grade", "");
         helpbutton("maxgrade", get_string("maximumgrade"), "quiz");
      ?>
index 20b9950e81e6d24668c5ae7dbb0a1ad8391c227a..60084f7bdc051e7aec14c99587d929331e202761 100644 (file)
     $table->align  = array("right", "left");
     $table->data[] = array("$strtimetaken:", $timetaken);
     $table->data[] = array("$strtimecompleted:", userdate($attempt->timefinish));
-    $table->data[] = array("$strscore:", "$result->sumgrades/$quiz->sumgrades ($result->percentage %)");
     if ($quiz->grade) {
+        $table->data[] = array("$strscore:", "$result->sumgrades/$quiz->sumgrades ($result->percentage %)");
         $table->data[] = array("$strgrade:", "$result->grade/$quiz->grade");
     }