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

MDL-20636 Add missing defined('MOODLE_INTERNAL') || die();

parent 7764183a
...@@ -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/>.
/** /**
* 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 * @package mod
* @subpackage quiz * @subpackage quiz
...@@ -24,6 +24,10 @@ ...@@ -24,6 +24,10 @@
* @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
*/ */
defined('MOODLE_INTERNAL') || die();
/** /**
* This class keeps track of the various access rules that apply to a particular * This class keeps track of the various access rules that apply to a particular
* quiz, with convinient methods for seeing whether access is allowed. * quiz, with convinient methods for seeing whether access is allowed.
......
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
*/ */
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir.'/formslib.php'); require_once($CFG->libdir.'/formslib.php');
......
...@@ -28,9 +28,7 @@ ...@@ -28,9 +28,7 @@
*/ */
if (!defined('MOODLE_INTERNAL')) { defined('MOODLE_INTERNAL') || die();
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page.
}
/** /**
......
...@@ -22,8 +22,12 @@ ...@@ -22,8 +22,12 @@
* @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
*/ */
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/mod/quiz/backup/moodle2/backup_quiz_stepslib.php'); // Because it exists (must) 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 * quiz backup task that provides all the settings and steps to perform one
* complete backup of the activity * complete backup of the activity
......
...@@ -22,12 +22,12 @@ ...@@ -22,12 +22,12 @@
* @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
*/ */
/**
* 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 { class backup_quiz_activity_structure_step extends backup_questions_activity_structure_step {
......
...@@ -22,10 +22,12 @@ ...@@ -22,10 +22,12 @@
* @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
*/ */
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/mod/quiz/backup/moodle2/restore_quiz_stepslib.php'); // Because it exists (must) 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 * quiz restore task that provides all the settings and steps to perform one
* complete restore of the activity * complete restore of the activity
......
...@@ -22,9 +22,9 @@ ...@@ -22,9 +22,9 @@
* @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
*/ */
/**
* 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 * Structure step to restore one quiz activity
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
* @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
*/ */
defined('MOODLE_INTERNAL') || die();
$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
......
...@@ -25,6 +25,9 @@ ...@@ -25,6 +25,9 @@
*/ */
defined('MOODLE_INTERNAL') || die();
/** /**
* Code run after the quiz module database tables have been created. * Code run after the quiz module database tables have been created.
*/ */
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
* @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
*/ */
defined('MOODLE_INTERNAL') || die();
$messageproviders = array ( $messageproviders = array (
// Notify teacher that a student has submitted a quiz attempt // Notify teacher that a student has submitted a quiz attempt
'submission' => array ( 'submission' => array (
......
...@@ -24,4 +24,6 @@ ...@@ -24,4 +24,6 @@
* @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
*/ */
defined('MOODLE_INTERNAL') || die();
$subplugins = array('quiz' => 'mod/quiz/report'); $subplugins = array('quiz' => 'mod/quiz/report');
...@@ -25,6 +25,9 @@ ...@@ -25,6 +25,9 @@
*/ */
defined('MOODLE_INTERNAL') || die();
/** /**
* Quiz module upgrade function. * Quiz module upgrade function.
* @param string $oldversion the version we are upgrading from. * @param string $oldversion the version we are upgrading from.
......
...@@ -30,8 +30,9 @@ ...@@ -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); define('NUM_QS_TO_SHOW_IN_RANDOM', 3);
......
...@@ -28,9 +28,9 @@ ...@@ -28,9 +28,9 @@
*/ */
/** Require {@link eventslib.php} */ defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir . '/eventslib.php'); require_once($CFG->libdir . '/eventslib.php');
/** Require {@link calendar/lib.php} */
require_once($CFG->dirroot . '/calendar/lib.php'); require_once($CFG->dirroot . '/calendar/lib.php');
......
...@@ -30,13 +30,9 @@ ...@@ -30,13 +30,9 @@
* @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')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page.
}
/** defined('MOODLE_INTERNAL') || die();
* Include those library functions that are also used by core Moodle or other modules
*/
require_once($CFG->dirroot . '/mod/quiz/lib.php'); require_once($CFG->dirroot . '/mod/quiz/lib.php');
require_once($CFG->dirroot . '/mod/quiz/accessrules.php'); require_once($CFG->dirroot . '/mod/quiz/accessrules.php');
require_once($CFG->dirroot . '/mod/quiz/attemptlib.php'); require_once($CFG->dirroot . '/mod/quiz/attemptlib.php');
...@@ -44,7 +40,6 @@ require_once($CFG->dirroot . '/question/editlib.php'); ...@@ -44,7 +40,6 @@ require_once($CFG->dirroot . '/question/editlib.php');
require_once($CFG->libdir . '/eventslib.php'); require_once($CFG->libdir . '/eventslib.php');
require_once($CFG->libdir . '/filelib.php'); require_once($CFG->libdir . '/filelib.php');
/// Constants ///////////////////////////////////////////////////////////////////
/**#@+ /**#@+
* Options determining how the grades from individual attempts are combined to give * Options determining how the grades from individual attempts are combined to give
......
...@@ -25,9 +25,7 @@ ...@@ -25,9 +25,7 @@
*/ */
if (!defined('MOODLE_INTERNAL')) { defined('MOODLE_INTERNAL') || die();
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
}
require_once($CFG->dirroot . '/course/moodleform_mod.php'); require_once($CFG->dirroot . '/course/moodleform_mod.php');
require_once($CFG->dirroot . '/mod/quiz/locallib.php'); require_once($CFG->dirroot . '/mod/quiz/locallib.php');
......
...@@ -25,9 +25,7 @@ ...@@ -25,9 +25,7 @@
*/ */
if (!defined('MOODLE_INTERNAL')) { defined('MOODLE_INTERNAL') || die();
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
}
require_once $CFG->libdir.'/formslib.php'; require_once $CFG->libdir.'/formslib.php';
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
*/ */
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir.'/tablelib.php'); require_once($CFG->libdir.'/tablelib.php');
......
...@@ -25,6 +25,9 @@ ...@@ -25,6 +25,9 @@
*/ */
defined('MOODLE_INTERNAL') || die();
/** /**
* Base class for quiz report plugins. * Base class for quiz report plugins.
* *
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
* @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
*/ */
defined('MOODLE_INTERNAL') || die();
$capabilities = array( $capabilities = array(
// Is the user allowed to see the student's real names while grading? // Is the user allowed to see the student's real names while grading?
'quiz/grading:viewstudentnames' => array( 'quiz/grading:viewstudentnames' => array(
......
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