moodle/mod/quiz/report/default.php
Sam Hemelryk 56ed242b51 navigation MDL-20276 Fixed up the navigation for the quiz module and question section as per Tim's recommendation.
* Routine navigation through the quiz and question modules
* Fixed navbar through quiz and questions
* Pages headers added throughout
* Added method to turn a navigation node into a tabs array suitable for use with print tabs
2010-05-21 03:15:48 +00:00

43 lines
1.6 KiB
PHP

<?php
////////////////////////////////////////////////////////////////////
/// Default class for report plugins
///
/// Doesn't do anything on it's own -- it needs to be extended.
/// This class displays quiz reports. Because it is called from
/// within /mod/quiz/report.php you can assume that the page header
/// and footer are taken care of.
///
/// This file can refer to itself as report.php to pass variables
/// to itself - all these will also be globally available. You must
/// pass "id=$cm->id" or q=$quiz->id", and "mode=reportname".
////////////////////////////////////////////////////////////////////
// Included by ../report.php
class quiz_default_report {
function display($cm, $course, $quiz) { /// This function just displays the report
return true;
}
function print_header_and_tabs($cm, $course, $quiz, $reportmode="overview") {
global $CFG, $PAGE, $OUTPUT;
/// Define some strings
$strquizzes = get_string("modulenameplural", "quiz");
$strquiz = get_string("modulename", "quiz");
/// Print the page header
$PAGE->set_title(format_string($quiz->name));
$PAGE->set_heading($course->fullname);
echo $OUTPUT->header();
$course_context = get_context_instance(CONTEXT_COURSE, $course->id);
if (has_capability('gradereport/grader:view', $course_context) && has_capability('moodle/grade:viewall', $course_context)) {
echo '<div class="allcoursegrades"><a href="' . $CFG->wwwroot . '/grade/report/grader/index.php?id=' . $course->id . '">'
. get_string('seeallcoursegrades', 'grades') . '</a></div>';
}
}
}