Skip to content
Permalink
Browse files

Improved display of quiz listing to show the closing date, as well as

direct links for the teacher to review attempts.  Thanks, Scott Elliott!
  • Loading branch information...
moodler
moodler committed Jun 7, 2003
1 parent 51bc7fb commit 4fa7532c246a86f573b92ff1c0b9ffd5cc273de5
Showing with 32 additions and 9 deletions.
  1. +32 −9 mod/quiz/index.php
@@ -42,18 +42,26 @@
$strweek = get_string("week");
$strtopic = get_string("topic");
$strbestgrade = get_string("bestgrade", "quiz");
$strquizcloses = get_string("quizcloses", "quiz");
$strattempts = get_string("attempts", "quiz");
if (isteacher($course->id)) {
$gradecol = $strattempts;
} else {
$gradecol = $strbestgrade;
}
if ($course->format == "weeks") {
$table->head = array ($strweek, $strname, $strbestgrade);
$table->align = array ("CENTER", "LEFT", "RIGHT");
$table->head = array ($strweek, $strname, $strquizcloses, $gradecol);
$table->align = array ("center", "left", "left", "left");
$table->width = array (10, "*", 10);
} else if ($course->format == "topics") {
$table->head = array ($strtopic, $strname, $strbestgrade);
$table->align = array ("CENTER", "LEFT", "RIGHT");
$table->head = array ($strtopic, $strname, $strquizcloses, $gradecol);
$table->align = array ("center", "left", "left", "left");
$table->width = array (10, "*", 10);
} else {
$table->head = array ($strname, $strbestgrade);
$table->align = array ("LEFT", "RIGHT");
$table->head = array ($strname, $strquizcloses, $gradecol);
$table->align = array ("left", "left", "left");
$table->width = array ("*", 10);
}
@@ -74,14 +82,29 @@
$section = "";
}
$closequiz = userdate($quiz->timeclose);
if (isteacher($course->id)) {
if ($allanswers = get_records("quiz_grades", "quiz", $quiz->id)) {
$answercount = count($allanswers);
$gradecol = "<a href=\"report.php?id=$quiz->coursemodule\">" .
get_string("viewallanswers","quiz",$answercount)."</a>";
} else {
$answercount = 0;
$gradecol = "";
}
} else {
$gradecol = "$bestgrade / $quiz->grade";
}
if ($course->format == "weeks" or $course->format == "topics") {
$table->data[] = array ($section, $link, "$bestgrade / $quiz->grade");
$table->data[] = array ($section, $link, $closequiz, $gradecol);
} else {
$table->data[] = array ($link, "$bestgrade / $quiz->grade");
$table->data[] = array ($link, $closequiz, $gradecol);
}
}
echo "<BR>";
echo "<br />";
print_table($table);

0 comments on commit 4fa7532

Please sign in to comment.
You can’t perform that action at this time.