Permalink
Browse files

All grades are hidden now when zero grade is chosen ... even the marks.

This mode is only really useful when feedback is turned on.
  • Loading branch information...
1 parent 7956138 commit 081bf74fb10b39553746f8ad9b01cb24e8570183 moodler committed Sep 10, 2003
Showing with 13 additions and 9 deletions.
  1. +1 −1 mod/quiz/attempt.php
  2. +8 −6 mod/quiz/lib.php
  3. +3 −1 mod/quiz/mod.html
  4. +1 −1 mod/quiz/review.php
@@ -133,8 +133,8 @@
$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");
}
View
@@ -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 \>";
}
View
@@ -202,9 +202,11 @@
<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");
?>
View
@@ -102,8 +102,8 @@
$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");
}

0 comments on commit 081bf74

Please sign in to comment.