mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Teachers can choose to allow review of quizzes, which means that students
are allowed to see past quizzes. This only works once the quiz is completely closed (to perhaps prevent easy cheating).
This commit is contained in:
parent
d78ab28640
commit
8e6c87ccf3
6 changed files with 90 additions and 22 deletions
|
@ -96,6 +96,8 @@
|
|||
$strgrade = get_string("grade");
|
||||
$strbestgrade = get_string("bestgrade", "quiz");
|
||||
|
||||
$mygrade = quiz_get_best_grade($quiz->id, $USER->id);
|
||||
|
||||
if ($numattempts) {
|
||||
$table->head = array($strattempt, $strtimetaken, $strtimecompleted, "$strgrade / $quiz->grade");
|
||||
$table->align = array("CENTER", "CENTER", "LEFT", "RIGHT");
|
||||
|
@ -106,10 +108,17 @@
|
|||
} else {
|
||||
$timetaken = "-";
|
||||
}
|
||||
$attemptgrade = format_float(($attempt->sumgrades/$quiz->sumgrades)*$quiz->grade);
|
||||
if ($attemptgrade == $mygrade) {
|
||||
$attemptgrade = "<SPAN class=highlight>$attemptgrade</SPAN>";
|
||||
}
|
||||
if (!$available and $quiz->review) {
|
||||
$attemptgrade = "<A HREF=\"report.php?q=$quiz->id&review=$attempt->id\">$attemptgrade</A>";
|
||||
}
|
||||
$table->data[] = array( $attempt->attempt,
|
||||
format_time($attempt->timefinish - $attempt->timestart),
|
||||
userdate($attempt->timefinish),
|
||||
format_float(($attempt->sumgrades/$quiz->sumgrades)*$quiz->grade) );
|
||||
$attemptgrade);
|
||||
}
|
||||
print_table($table);
|
||||
}
|
||||
|
@ -122,7 +131,6 @@
|
|||
echo "<P ALIGN=CENTER>".get_string("quizclosed", "quiz", userdate($quiz->timeclose));
|
||||
}
|
||||
|
||||
$mygrade = quiz_get_best_grade($quiz->id, $USER->id);
|
||||
|
||||
if (!$quiz->questions) {
|
||||
print_heading(get_string("noquestions", "quiz"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue