id); add_to_log($course->id, "quiz", "view all", "index.php?id=$course->id", ""); // Print the header $strquizzes = get_string("modulenameplural", "quiz"); $strquiz = get_string("modulename", "quiz"); if ($course->category) { $navigation = "id\">$course->shortname ->"; } print_header("$course->shortname: $strquizzes", "$course->fullname", "$navigation $strquizzes", "", "", true, "", navmenu($course)); // Get all the appropriate data if (! $quizzes = get_all_instances_in_course("quiz", $course->id, "cw.section ASC")) { notice("There are no quizzes", "../../course/view.php?id=$course->id"); die; } // Print the list of instances (your module will probably extend this) $timenow = time(); $strname = get_string("name"); $strweek = get_string("week"); $strtopic = get_string("topic"); $strbestgrade = get_string("bestgrade", "quiz"); if ($course->format == "weeks") { $table->head = array ($strweek, $strname, $strbestgrade); $table->align = array ("CENTER", "LEFT", "RIGHT"); $table->width = array (10, "*", 10); } else if ($course->format == "topics") { $table->head = array ($strtopic, $strname, $strbestgrade); $table->align = array ("CENTER", "LEFT", "RIGHT"); $table->width = array (10, "*", 10); } else { $table->head = array ($strname, $strbestgrade); $table->align = array ("LEFT", "RIGHT"); $table->width = array ("*", 10); } foreach ($quizzes as $quiz) { $link = "coursemodule\">$quiz->name"; $bestgrade = quiz_get_best_grade($quiz->id, $USER->id); if ($quiz->section) { $section = "$quiz->section"; } else { $section = ""; } if ($course->format == "weeks" or $course->format == "topics") { $table->data[] = array ($section, $link, "$bestgrade / $quiz->grade"); } else { $table->data[] = array ($link, "$bestgrade / $quiz->grade"); } } echo "
"; print_table($table); // Finish the page print_footer($course); ?>