$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");
}
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
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);
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 \>";
}
<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");
?>
$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");
}