Commit ba643847 authored by Tim Hunt's avatar Tim Hunt
Browse files

MDL-20636 Fix top of file boilerplate in mod/quiz.

parent b04a4319
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
/** /**
* Sets up the tabs used by the quiz pages based on the users capabilites. * Sets up the tabs used by the quiz pages based on the users capabilites.
* *
* @package mod * @package mod
* @subpackage quiz * @subpackage quiz
* @copyright 2009 Tim Hunt * @copyright 2009 Tim Hunt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
/** /**
...@@ -430,6 +430,7 @@ class quiz_access_manager { ...@@ -430,6 +430,7 @@ class quiz_access_manager {
} }
} }
/** /**
* A base class that defines the interface for the various quiz access rules. * A base class that defines the interface for the various quiz access rules.
* Most of the methods are defined in a slightly unnatural way because we either * Most of the methods are defined in a slightly unnatural way because we either
......
<?php <?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/** /**
* Fallback page of /mod/quiz/edit.php add random question dialog, * Fallback page of /mod/quiz/edit.php add random question dialog,
* for users who do not use javascript. * for users who do not use javascript.
* *
* @author Olli Savolainen, as a part of the Quiz UI Redesign project in Summer 2008 * @package mod
* {@link http://docs.moodle.org/en/Development:Quiz_UI_redesign}. * @subpackage quiz
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License * @copyright 2008 Olli Savolainen
* @package quiz * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
require_once('../../config.php'); require_once('../../config.php');
require_once($CFG->dirroot . '/mod/quiz/editlib.php'); require_once($CFG->dirroot . '/mod/quiz/editlib.php');
require_once($CFG->dirroot . '/mod/quiz/addrandomform.php'); require_once($CFG->dirroot . '/mod/quiz/addrandomform.php');
......
<?php <?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Defines the Moodle forum used to add random questions to the quiz.
*
* @package mod
* @subpackage quiz
* @copyright 2008 Olli Savolainen
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once($CFG->libdir.'/formslib.php'); require_once($CFG->libdir.'/formslib.php');
/**
* The add random questions form.
*
* @copyright 1999 onwards Martin Dougiamas and others {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class quiz_add_random_form extends moodleform { class quiz_add_random_form extends moodleform {
function definition() { function definition() {
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
/** /**
* This script displays a particular page of a quiz attempt that is in progress. * This script displays a particular page of a quiz attempt that is in progress.
* *
* @package mod * @package mod
* @subpackage quiz * @subpackage quiz
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
require_once(dirname(__FILE__) . '/../../config.php'); require_once(dirname(__FILE__) . '/../../config.php');
......
...@@ -21,10 +21,10 @@ ...@@ -21,10 +21,10 @@
* There are classes for loading all the information about a quiz and attempts, * There are classes for loading all the information about a quiz and attempts,
* and for displaying the navigation panel. * and for displaying the navigation panel.
* *
* @package mod * @package mod
* @subpackage quiz * @subpackage quiz
* @copyright 2008 onwards Tim Hunt * @copyright 2008 onwards Tim Hunt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
......
...@@ -19,10 +19,10 @@ ...@@ -19,10 +19,10 @@
* This page allows the teacher to enter a manual grade for a particular question. * This page allows the teacher to enter a manual grade for a particular question.
* This page is expected to only be used in a popup window. * This page is expected to only be used in a popup window.
* *
* @package mod * @package mod
* @subpackage quiz * @subpackage quiz
* @copyright gustav delius 2006 * @copyright gustav delius 2006
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
require_once('../../config.php'); require_once('../../config.php');
......
<?php <?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/** /**
* Capability definitions for the quiz module. * Capability definitions for the quiz module.
* *
* For naming conventions, see lib/db/access.php. * @package mod
* @subpackage quiz
* @copyright 2006 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
$capabilities = array( $capabilities = array(
// Ability to see that the quiz exists, and the basic information // Ability to see that the quiz exists, and the basic information
......
<?php <?php
// This file replaces: // This file is part of Moodle - http://moodle.org/
// * STATEMENTS section in db/install.xml //
// * lib.php/modulename_install() post installation hook // Moodle is free software: you can redistribute it and/or modify
// * partially defaults.php // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Post-install code for the quiz module.
*
* @package mod
* @subpackage quiz
* @copyright 2009 Petr Skoda
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Code run after the quiz module database tables have been created.
*/
function xmldb_quiz_install() { function xmldb_quiz_install() {
global $DB; global $DB;
...@@ -22,5 +45,4 @@ function xmldb_quiz_install() { ...@@ -22,5 +45,4 @@ function xmldb_quiz_install() {
$record->name = 'grading'; $record->name = 'grading';
$record->displayorder = '6000'; $record->displayorder = '6000';
$DB->insert_record('quiz_report', $record); $DB->insert_record('quiz_report', $record);
} }
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/** /**
* Definition of log events * Definition of log events for the quiz module.
* *
* @package mod * @package mod
* @subpackage quiz * @subpackage quiz
......
...@@ -16,12 +16,12 @@ ...@@ -16,12 +16,12 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/** /**
* Defines message providers (types of messages being sent) * Defines message providers (types of message sent) for the quiz module.
* *
* @package mod * @package mod
* @subpackage quiz * @subpackage quiz
* @copyright 2010 onwards Andrew Davis http://moodle.com * @copyright 2010 Andrew Davis http://moodle.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
$messageproviders = array ( $messageproviders = array (
......
<?php <?php
$subplugins = array('quiz'=>'mod/quiz/report'); // This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Sub-plugin definitions for the quiz module.
*
* @package mod
* @subpackage quiz
* @copyright 2010 Petr Skoda
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$subplugins = array('quiz' => 'mod/quiz/report');
<?php <?php
// This file keeps track of upgrades to // This file is part of Moodle - http://moodle.org/
// the quiz module
// //
// Sometimes, changes between versions involve // Moodle is free software: you can redistribute it and/or modify
// alterations to database structures and other // it under the terms of the GNU General Public License as published by
// major things that may break installations. // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// //
// The upgrade function in this file will attempt // Moodle is distributed in the hope that it will be useful,
// to perform all the necessary actions to upgrade // but WITHOUT ANY WARRANTY; without even the implied warranty of
// your older installation to the current version. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// //
// If there's something it cannot do itself, it // You should have received a copy of the GNU General Public License
// will tell you what you need to do. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
//
// The commands in here will all be database-neutral, /**
// using the methods of database_manager class * Upgrade script for the quiz module.
// *
// Please do not forget to use upgrade_set_timeout() * @package mod
// before any action that may take longer time to finish. * @subpackage quiz
* @copyright 2006 Eloy Lafuente (stronk7)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Quiz module upgrade function.
* @param string $oldversion the version we are upgrading from.
*/
function xmldb_quiz_upgrade($oldversion) { function xmldb_quiz_upgrade($oldversion) {
global $CFG, $DB; global $CFG, $DB;
......
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
/** /**
* JavaScript library for the quiz module editing interface. * JavaScript library for the quiz module editing interface.
* *
* @package mod * @package mod
* @subpackage quiz * @subpackage quiz
* @copyright 2008 Olli Savolainen * @copyright 2008 Olli Savolainen
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
......
...@@ -36,10 +36,10 @@ ...@@ -36,10 +36,10 @@
* delete Removes a question from the quiz * delete Removes a question from the quiz
* savechanges Saves the order and grades for questions in the quiz * savechanges Saves the order and grades for questions in the quiz
* *
* @package mod * @package mod
* @subpackage quiz * @subpackage quiz
* @copyright 1999 onwards Martin Dougiamas and others {@link http://moodle.com} * @copyright 1999 onwards Martin Dougiamas and others {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
......
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
* the module-indpendent code for handling questions and which in turn * the module-indpendent code for handling questions and which in turn
* initialises all the questiontype classes. * initialises all the questiontype classes.
* *
* @package mod * @package mod
* @subpackage quiz * @subpackage quiz
* @copyright 1999 onwards Martin Dougiamas and others {@link http://moodle.com} * @copyright 1999 onwards Martin Dougiamas and others {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
......
<?php <?php
require_once("../../config.php"); // This file is part of Moodle - http://moodle.org/
//
$id = required_param('id', PARAM_INT); // Course module ID // Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
if (! $cm = get_coursemodule_from_id('quiz', $id)) { // the Free Software Foundation, either version 3 of the License, or
print_error('invalidcoursemodule'); // (at your option) any later version.
} //
// Moodle is distributed in the hope that it will be useful,
if (! $quiz = $DB->get_record('quiz', array('id' => $cm->instance))) { // but WITHOUT ANY WARRANTY; without even the implied warranty of
print_error('invalidquizid'); // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
} // GNU General Public License for more details.
//
if (! $course = $DB->get_record('course', array('id' => $quiz->course))) { // You should have received a copy of the GNU General Public License
print_error('coursemisconf'); // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}
/**
require_login($course->id, false, $cm); * This page is the entry page into the quiz UI. Displays information about the
* quiz to students and teachers, and lets students see their previous attempts.
if (has_capability('mod/quiz:viewreports', get_context_instance(CONTEXT_MODULE, $cm->id))) { *
redirect('report.php?id='.$cm->id); * @package mod
} else { * @subpackage quiz
redirect('view.php?id='.$cm->id); * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../../config.php');
require_once($CFG->dirroot . '/mod/quiz/report/reportlib.php');
$id = required_param('id', PARAM_INT);
if (!$cm = get_coursemodule_from_id('quiz', $id)) {
print_error('invalidcoursemodule');
}
if (!$quiz = $DB->get_record('quiz', array('id' => $cm->instance))) {
print_error('invalidquizid');
}
if (!$course = $DB->get_record('course', array('id' => $quiz->course))) {
print_error('coursemisconf');
}
require_login($course, false, $cm);
$reportlist = quiz_report_list(get_context_instance(CONTEXT_MODULE, $cm->id));
if (!empty($reportlist)) {
redirect(new moodle_url('/mod/quiz/report.php', array(
'id' => $cm->id, 'mode' => reset($reportlist))));
} else {
redirect(new moodle_url('/mod/quiz/view.php', array('id' => $cm->id)));
}
...@@ -15,15 +15,16 @@ ...@@ -15,15 +15,16 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/** /**
* This script lists all the instances of quiz in a particular course * This script lists all the instances of quiz in a particular course
* *
* @package mod * @package mod
* @subpackage quiz * @subpackage quiz
* @author Martin Dougiamas and many others. * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
require_once("../../config.php"); require_once("../../config.php");
require_once("locallib.php"); require_once("locallib.php");
......
...@@ -18,9 +18,10 @@ ...@@ -18,9 +18,10 @@
/** /**
* Strings for component 'quiz', language 'en', branch 'MOODLE_20_STABLE' * Strings for component 'quiz', language 'en', branch 'MOODLE_20_STABLE'
* *
* @package quiz * @package mod
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} * @subpackage quiz
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
$string['acceptederror'] = 'Accepted error'; $string['acceptederror'] = 'Accepted error';
......
...@@ -21,10 +21,10 @@ ...@@ -21,10 +21,10 @@
* This contains functions that are called also from outside the quiz module * This contains functions that are called also from outside the quiz module
* Functions that are only called by the quiz module itself are in {@link locallib.php} * Functions that are only called by the quiz module itself are in {@link locallib.php}
* *
* @package mod * @package mod
* @subpackage quiz * @subpackage quiz
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
......
...@@ -24,10 +24,10 @@ ...@@ -24,10 +24,10 @@
* the module-indpendent code for handling questions and which in turn * the module-indpendent code for handling questions and which in turn
* initialises all the questiontype classes. * initialises all the questiontype classes.
* *
* @package mod * @package mod
* @subpackage quiz * @subpackage quiz
* @copyright 1999 onwards Martin Dougiamas and others {@link http://moodle.com} * @copyright 1999 onwards Martin Dougiamas and others {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
if (!defined('MOODLE_INTERNAL')) { if (!defined('MOODLE_INTERNAL')) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment