2 /// This file to be included so we can assume config.php has already been included.
5 error('You cannot call this script in that way');
7 if (!isset($currenttab)) {
11 $cm = get_coursemodule_from_instance('quiz', $quiz->id
);
13 if (!isset($course)) {
14 $course = get_record('course', 'id', $quiz->course
);
17 //print_heading(format_string($quiz->name));
23 $row[] = new tabobject('info', "view.php?q=$quiz->id", get_string('info', 'quiz'));
24 $row[] = new tabobject('reports', "report.php?q=$quiz->id", get_string('reports', 'quiz'));
25 $row[] = new tabobject('preview', "attempt.php?q=$quiz->id", get_string('preview', 'quiz'));
26 if (isteacheredit($course->id
)) {
27 $row[] = new tabobject('edit', "edit.php?quizid=$quiz->id", get_string('editquiz', 'quiz'));
28 //$row[] = new tabobject('update', "$CFG->wwwroot/course/mod.php?update=$cm->id&sesskey=$USER->sesskey", get_string('updatethis', '', get_string('modulename', 'quiz')));
33 if ($currenttab == 'reports' and isset($mode)) {
34 $inactive[] = 'reports';
35 $allreports = get_list_of_plugins("mod/quiz/report");
36 $reportlist = array ('overview', 'regrade', 'analysis'); // Standard reports we want to show first
38 foreach ($allreports as $report) {
39 if (!in_array($report, $reportlist)) {
40 $reportlist[] = $report;
46 foreach ($reportlist as $report) {
47 $row[] = new tabobject($report, "report.php?q=$quiz->id&mode=$report",
48 get_string("report$report", "quiz"));
49 if ($report == $mode) {
50 $currenttab = $report;
56 print_tabs($tabs, $currenttab, $inactive);