MDL-15384 'change name of quiz report classes to "quiz_{reportname}_report"' easy to do, changed class name of all reports and changed the code in report.php which instantiates the correct class.

This commit is contained in:
jamiesensei 2008-06-24 08:59:29 +00:00
parent 4b4a5710a2
commit c386eaa3df
6 changed files with 7 additions and 8 deletions

View file

@ -59,8 +59,6 @@
/// Open the selected quiz report and display it /// Open the selected quiz report and display it
$mode = clean_param($mode, PARAM_SAFEDIR);
if (! is_readable("report/$mode/report.php")) { if (! is_readable("report/$mode/report.php")) {
print_error('reportnotfound', 'quiz', '', $mode); print_error('reportnotfound', 'quiz', '', $mode);
} }
@ -68,7 +66,8 @@
include("report/default.php"); // Parent class include("report/default.php"); // Parent class
include("report/$mode/report.php"); include("report/$mode/report.php");
$report = new quiz_report(); $reportclassname = "quiz_{$mode}_report";
$report = new $reportclassname();
if (! $report->display($quiz, $cm, $course)) { // Run the report! if (! $report->display($quiz, $cm, $course)) { // Run the report!
print_error("preprocesserror", 'quiz'); print_error("preprocesserror", 'quiz');

View file

@ -3,7 +3,7 @@
require_once($CFG->libdir.'/tablelib.php'); require_once($CFG->libdir.'/tablelib.php');
/// Item analysis displays a table of quiz questions and their performance /// Item analysis displays a table of quiz questions and their performance
class quiz_report extends quiz_default_report { class quiz_analysis_report extends quiz_default_report {
function display($quiz, $cm, $course) { /// This function just displays the report function display($quiz, $cm, $course) { /// This function just displays the report
global $CFG, $SESSION, $QTYPES, $DB; global $CFG, $SESSION, $QTYPES, $DB;

View file

@ -23,7 +23,7 @@ require_once($CFG->libdir . '/tablelib.php');
* @package quiz * @package quiz
* @subpackage reports * @subpackage reports
*/ */
class quiz_report extends quiz_default_report { class quiz_grading_report extends quiz_default_report {
/** /**
* Displays the report. * Displays the report.
*/ */

View file

@ -12,7 +12,7 @@ require_once($CFG->libdir.'/tablelib.php');
require_once($CFG->dirroot.'/mod/quiz/report/overview/overviewsettings_form.php'); require_once($CFG->dirroot.'/mod/quiz/report/overview/overviewsettings_form.php');
require_once($CFG->dirroot.'/mod/quiz/report/overview/overview_table.php'); require_once($CFG->dirroot.'/mod/quiz/report/overview/overview_table.php');
class quiz_report extends quiz_default_report { class quiz_overview_report extends quiz_default_report {
/** /**
* Display the report. * Display the report.

View file

@ -3,7 +3,7 @@
// This script regrades all attempts at this quiz // This script regrades all attempts at this quiz
require_once($CFG->libdir.'/tablelib.php'); require_once($CFG->libdir.'/tablelib.php');
class quiz_report extends quiz_default_report { class quiz_regrade_report extends quiz_default_report {
function display($quiz, $cm, $course) { function display($quiz, $cm, $course) {
global $CFG, $DB; global $CFG, $DB;

View file

@ -11,7 +11,7 @@
require_once($CFG->dirroot.'/mod/quiz/report/statistics/statistics_form.php'); require_once($CFG->dirroot.'/mod/quiz/report/statistics/statistics_form.php');
require_once($CFG->dirroot.'/mod/quiz/report/statistics/statistics_table.php'); require_once($CFG->dirroot.'/mod/quiz/report/statistics/statistics_table.php');
class quiz_report extends quiz_default_report { class quiz_statistics_report extends quiz_default_report {
/** /**
* Display the report. * Display the report.