Skip to content

Commit

Permalink
MDL-20636 Add missing defined('MOODLE_INTERNAL') || die();
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt committed Feb 23, 2011
1 parent 7764183 commit a17b297
Show file tree
Hide file tree
Showing 294 changed files with 713 additions and 4,127 deletions.
6 changes: 5 additions & 1 deletion mod/quiz/accessrules.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Sets up the tabs used by the quiz pages based on the users capabilites.
* Classes to enforce the various access rules that can apply to a quiz.
*
* @package mod
* @subpackage quiz
* @copyright 2009 Tim Hunt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/


defined('MOODLE_INTERNAL') || die();


/**
* This class keeps track of the various access rules that apply to a particular
* quiz, with convinient methods for seeing whether access is allowed.
Expand Down
2 changes: 2 additions & 0 deletions mod/quiz/addrandomform.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
*/


defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir.'/formslib.php');


Expand Down
4 changes: 1 addition & 3 deletions mod/quiz/attemptlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
*/


if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page.
}
defined('MOODLE_INTERNAL') || die();


/**
Expand Down
4 changes: 4 additions & 0 deletions mod/quiz/backup/moodle2/backup_quiz_activity_task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/


defined('MOODLE_INTERNAL') || die();

require_once($CFG->dirroot . '/mod/quiz/backup/moodle2/backup_quiz_stepslib.php'); // Because it exists (must)


/**
* quiz backup task that provides all the settings and steps to perform one
* complete backup of the activity
Expand Down
8 changes: 4 additions & 4 deletions mod/quiz/backup/moodle2/backup_quiz_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

/**
* Define all the backup steps that will be used by the backup_quiz_activity_task
*/

defined('MOODLE_INTERNAL') || die();


/**
* Define the complete quiz structure for backup, with file and id annotations
* Define all the backup steps that will be used by the backup_quiz_activity_task
*/
class backup_quiz_activity_structure_step extends backup_questions_activity_structure_step {

Expand Down
2 changes: 2 additions & 0 deletions mod/quiz/backup/moodle2/restore_quiz_activity_task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/


defined('MOODLE_INTERNAL') || die();

require_once($CFG->dirroot . '/mod/quiz/backup/moodle2/restore_quiz_stepslib.php'); // Because it exists (must)


/**
* quiz restore task that provides all the settings and steps to perform one
* complete restore of the activity
Expand Down
6 changes: 3 additions & 3 deletions mod/quiz/backup/moodle2/restore_quiz_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

/**
* Define all the restore steps that will be used by the restore_quiz_activity_task
*/

defined('MOODLE_INTERNAL') || die();


/**
* Structure step to restore one quiz activity
Expand Down
2 changes: 2 additions & 0 deletions mod/quiz/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

$capabilities = array(

// Ability to see that the quiz exists, and the basic information
Expand Down
3 changes: 3 additions & 0 deletions mod/quiz/db/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
*/


defined('MOODLE_INTERNAL') || die();


/**
* Code run after the quiz module database tables have been created.
*/
Expand Down
2 changes: 2 additions & 0 deletions mod/quiz/db/messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

$messageproviders = array (
// Notify teacher that a student has submitted a quiz attempt
'submission' => array (
Expand Down
2 changes: 2 additions & 0 deletions mod/quiz/db/subplugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

$subplugins = array('quiz' => 'mod/quiz/report');
3 changes: 3 additions & 0 deletions mod/quiz/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
*/


defined('MOODLE_INTERNAL') || die();


/**
* Quiz module upgrade function.
* @param string $oldversion the version we are upgrading from.
Expand Down
3 changes: 2 additions & 1 deletion mod/quiz/editlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@
*/


require_once($CFG->dirroot . '/mod/quiz/locallib.php');
defined('MOODLE_INTERNAL') || die();

require_once($CFG->dirroot . '/mod/quiz/locallib.php');

define('NUM_QS_TO_SHOW_IN_RANDOM', 3);

Expand Down
4 changes: 2 additions & 2 deletions mod/quiz/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
*/


/** Require {@link eventslib.php} */
defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir . '/eventslib.php');
/** Require {@link calendar/lib.php} */
require_once($CFG->dirroot . '/calendar/lib.php');


Expand Down
9 changes: 2 additions & 7 deletions mod/quiz/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,16 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page.
}

/**
* Include those library functions that are also used by core Moodle or other modules
*/
defined('MOODLE_INTERNAL') || die();

require_once($CFG->dirroot . '/mod/quiz/lib.php');
require_once($CFG->dirroot . '/mod/quiz/accessrules.php');
require_once($CFG->dirroot . '/mod/quiz/attemptlib.php');
require_once($CFG->dirroot . '/question/editlib.php');
require_once($CFG->libdir . '/eventslib.php');
require_once($CFG->libdir . '/filelib.php');

/// Constants ///////////////////////////////////////////////////////////////////

/**#@+
* Options determining how the grades from individual attempts are combined to give
Expand Down
4 changes: 1 addition & 3 deletions mod/quiz/mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
*/


if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
}
defined('MOODLE_INTERNAL') || die();

require_once($CFG->dirroot . '/course/moodleform_mod.php');
require_once($CFG->dirroot . '/mod/quiz/locallib.php');
Expand Down
4 changes: 1 addition & 3 deletions mod/quiz/override_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
*/


if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
}
defined('MOODLE_INTERNAL') || die();

require_once $CFG->libdir.'/formslib.php';

Expand Down
2 changes: 2 additions & 0 deletions mod/quiz/report/attemptsreport.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
*/


defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir.'/tablelib.php');


Expand Down
3 changes: 3 additions & 0 deletions mod/quiz/report/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
*/


defined('MOODLE_INTERNAL') || die();


/**
* Base class for quiz report plugins.
*
Expand Down
2 changes: 2 additions & 0 deletions mod/quiz/report/grading/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

$capabilities = array(
// Is the user allowed to see the student's real names while grading?
'quiz/grading:viewstudentnames' => array(
Expand Down
2 changes: 2 additions & 0 deletions mod/quiz/report/grading/gradingsettings_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
*/


defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir . '/formslib.php');


Expand Down
2 changes: 2 additions & 0 deletions mod/quiz/report/grading/report.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
*/


defined('MOODLE_INTERNAL') || die();

require_once($CFG->dirroot . '/mod/quiz/report/grading/gradingsettings_form.php');


Expand Down
2 changes: 2 additions & 0 deletions mod/quiz/report/grading/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2011021400;
6 changes: 5 additions & 1 deletion mod/quiz/report/overview/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@
*/


defined('MOODLE_INTERNAL') || die();


/**
* Quiz overview report upgrade function.
* @param number $oldversion
*/function xmldb_quiz_overview_upgrade($oldversion) {
*/
function xmldb_quiz_overview_upgrade($oldversion) {
global $CFG, $DB;

$dbman = $DB->get_manager();
Expand Down
3 changes: 3 additions & 0 deletions mod/quiz/report/overview/overview_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
*/


defined('MOODLE_INTERNAL') || die();


/**
* This is a table subclass for displaying the quiz grades report.
*
Expand Down
2 changes: 2 additions & 0 deletions mod/quiz/report/overview/overviewsettings_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
*/


defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir . '/formslib.php');


Expand Down
2 changes: 2 additions & 0 deletions mod/quiz/report/overview/report.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
*/


defined('MOODLE_INTERNAL') || die();

require_once($CFG->dirroot.'/mod/quiz/report/attemptsreport.php');
require_once($CFG->dirroot.'/mod/quiz/report/overview/overviewsettings_form.php');
require_once($CFG->dirroot.'/mod/quiz/report/overview/overview_table.php');
Expand Down
2 changes: 2 additions & 0 deletions mod/quiz/report/overview/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2011021600; // The (date) version of this module
3 changes: 3 additions & 0 deletions mod/quiz/report/reportlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/


defined('MOODLE_INTERNAL') || die();

require_once($CFG->dirroot . '/mod/quiz/lib.php');

define('QUIZ_REPORT_DEFAULT_PAGE_SIZE', 30);
Expand Down
2 changes: 2 additions & 0 deletions mod/quiz/report/responses/report.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
*/


defined('MOODLE_INTERNAL') || die();

require_once($CFG->dirroot.'/mod/quiz/report/attemptsreport.php');
require_once($CFG->dirroot.'/mod/quiz/report/responses/responsessettings_form.php');
require_once($CFG->dirroot.'/mod/quiz/report/responses/responses_table.php');
Expand Down
3 changes: 3 additions & 0 deletions mod/quiz/report/responses/responses_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
*/


defined('MOODLE_INTERNAL') || die();


/**
* This is a table subclass for displaying the quiz responses report.
*
Expand Down
2 changes: 2 additions & 0 deletions mod/quiz/report/responses/responsessettings_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
*/


defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir . '/formslib.php');


Expand Down
2 changes: 2 additions & 0 deletions mod/quiz/report/simpletest/testreportlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
*/


defined('MOODLE_INTERNAL') || die();

require_once(dirname(__FILE__) . '/../../../../config.php');

global $CFG;
Expand Down
3 changes: 3 additions & 0 deletions mod/quiz/report/statistics/cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/


defined('MOODLE_INTERNAL') || die();

require_once($CFG->dirroot . '/question/engine/compatibility.php');

/**
Expand Down
3 changes: 3 additions & 0 deletions mod/quiz/report/statistics/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
* @copyright 2008 Jamie Pratt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

$capabilities = array(
'quiz/statistics:view' => array(
'captype' => 'read',
Expand Down
3 changes: 3 additions & 0 deletions mod/quiz/report/statistics/db/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
*/


defined('MOODLE_INTERNAL') || die();


/**
* Post-install script
*/
Expand Down
Loading

0 comments on commit a17b297

Please sign in to comment.