From 4d0241e488507cda52d638f7c77986b61e4e46bb Mon Sep 17 00:00:00 2001 From: Ferran Recio Date: Tue, 12 May 2020 15:08:56 +0200 Subject: [PATCH] MDL-68241 mod_h5pactivity: remove MOODLE_INTERNAL --- mod/h5pactivity/classes/local/attempt.php | 2 -- mod/h5pactivity/classes/privacy/provider.php | 2 -- mod/h5pactivity/classes/xapi/handler.php | 1 + mod/h5pactivity/db/upgrade.php | 8 -------- mod/h5pactivity/lib.php | 4 ++-- mod/h5pactivity/mod_form.php | 1 + .../event/course_module_instance_list_viewed_test.php | 2 -- mod/h5pactivity/tests/event/course_module_viewed_test.php | 2 -- mod/h5pactivity/tests/event/statement_received_test.php | 2 -- mod/h5pactivity/tests/generator_test.php | 2 -- mod/h5pactivity/tests/local/attempt_test.php | 2 -- mod/h5pactivity/tests/privacy_test.php | 2 -- mod/h5pactivity/tests/xapi/handler_test.php | 2 -- 13 files changed, 4 insertions(+), 28 deletions(-) diff --git a/mod/h5pactivity/classes/local/attempt.php b/mod/h5pactivity/classes/local/attempt.php index 3b248755ccb..e037ebbcc01 100644 --- a/mod/h5pactivity/classes/local/attempt.php +++ b/mod/h5pactivity/classes/local/attempt.php @@ -28,8 +28,6 @@ namespace mod_h5pactivity\local; use stdClass; use core_xapi\local\statement; -defined('MOODLE_INTERNAL') || die(); - /** * Class attempt for H5P activity * diff --git a/mod/h5pactivity/classes/privacy/provider.php b/mod/h5pactivity/classes/privacy/provider.php index 8f6f1760256..729d68e0de6 100644 --- a/mod/h5pactivity/classes/privacy/provider.php +++ b/mod/h5pactivity/classes/privacy/provider.php @@ -35,8 +35,6 @@ use core_privacy\local\request\userlist; use core_privacy\local\request\writer; use stdClass; -defined('MOODLE_INTERNAL') || die(); - /** * Privacy API implementation for the H5P activity plugin. * diff --git a/mod/h5pactivity/classes/xapi/handler.php b/mod/h5pactivity/classes/xapi/handler.php index 4001e909322..b05a9102377 100644 --- a/mod/h5pactivity/classes/xapi/handler.php +++ b/mod/h5pactivity/classes/xapi/handler.php @@ -35,6 +35,7 @@ use context_module; defined('MOODLE_INTERNAL') || die(); +global $CFG; require_once($CFG->dirroot.'/mod/h5pactivity/lib.php'); /** diff --git a/mod/h5pactivity/db/upgrade.php b/mod/h5pactivity/db/upgrade.php index 4724f653ab3..d0fb851f427 100644 --- a/mod/h5pactivity/db/upgrade.php +++ b/mod/h5pactivity/db/upgrade.php @@ -39,14 +39,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -/** - * H5P activity module upgrade. - * - * @package mod_h5pactivity - * @copyright 2017 Stephen Bourget - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ - defined('MOODLE_INTERNAL') || die(); /** diff --git a/mod/h5pactivity/lib.php b/mod/h5pactivity/lib.php index 48f97a4e5fd..b3cb285dc37 100644 --- a/mod/h5pactivity/lib.php +++ b/mod/h5pactivity/lib.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +defined('MOODLE_INTERNAL') || die(); + use mod_h5pactivity\local\manager; use mod_h5pactivity\local\grader; -defined('MOODLE_INTERNAL') || die(); - /** * Checks if H5P activity supports a specific feature. * diff --git a/mod/h5pactivity/mod_form.php b/mod/h5pactivity/mod_form.php index 94b76059b22..d3c20d0dc4b 100644 --- a/mod/h5pactivity/mod_form.php +++ b/mod/h5pactivity/mod_form.php @@ -26,6 +26,7 @@ use mod_h5pactivity\local\manager; defined('MOODLE_INTERNAL') || die(); +global $CFG; require_once($CFG->dirroot.'/course/moodleform_mod.php'); /** diff --git a/mod/h5pactivity/tests/event/course_module_instance_list_viewed_test.php b/mod/h5pactivity/tests/event/course_module_instance_list_viewed_test.php index c381eea9507..15142c9be91 100644 --- a/mod/h5pactivity/tests/event/course_module_instance_list_viewed_test.php +++ b/mod/h5pactivity/tests/event/course_module_instance_list_viewed_test.php @@ -28,8 +28,6 @@ use advanced_testcase; use context_course; use context_module; -defined('MOODLE_INTERNAL') || die(); - /** * H5P activity events test cases. * diff --git a/mod/h5pactivity/tests/event/course_module_viewed_test.php b/mod/h5pactivity/tests/event/course_module_viewed_test.php index 57d2fe613d4..4813fce93d3 100644 --- a/mod/h5pactivity/tests/event/course_module_viewed_test.php +++ b/mod/h5pactivity/tests/event/course_module_viewed_test.php @@ -28,8 +28,6 @@ use advanced_testcase; use context_course; use context_module; -defined('MOODLE_INTERNAL') || die(); - /** * H5P activity events test cases. * diff --git a/mod/h5pactivity/tests/event/statement_received_test.php b/mod/h5pactivity/tests/event/statement_received_test.php index 17694600131..021043d6127 100644 --- a/mod/h5pactivity/tests/event/statement_received_test.php +++ b/mod/h5pactivity/tests/event/statement_received_test.php @@ -28,8 +28,6 @@ use advanced_testcase; use context_course; use context_module; -defined('MOODLE_INTERNAL') || die(); - /** * H5P activity events test cases. * diff --git a/mod/h5pactivity/tests/generator_test.php b/mod/h5pactivity/tests/generator_test.php index 0cd72c3f9ca..dbb7cfa3dfc 100644 --- a/mod/h5pactivity/tests/generator_test.php +++ b/mod/h5pactivity/tests/generator_test.php @@ -25,8 +25,6 @@ use mod_h5pactivity\local\manager; -defined('MOODLE_INTERNAL') || die(); - /** * Genarator tests class for mod_h5pactivity. * diff --git a/mod/h5pactivity/tests/local/attempt_test.php b/mod/h5pactivity/tests/local/attempt_test.php index 494d20ea564..6cec3c2b067 100644 --- a/mod/h5pactivity/tests/local/attempt_test.php +++ b/mod/h5pactivity/tests/local/attempt_test.php @@ -34,8 +34,6 @@ use \core_xapi\local\statement\item_verb; use \core_xapi\local\statement\item_result; use stdClass; -defined('MOODLE_INTERNAL') || die(); - /** * Attempt tests class for mod_h5pactivity. * diff --git a/mod/h5pactivity/tests/privacy_test.php b/mod/h5pactivity/tests/privacy_test.php index bc3b77a0733..9966abb5711 100644 --- a/mod/h5pactivity/tests/privacy_test.php +++ b/mod/h5pactivity/tests/privacy_test.php @@ -25,8 +25,6 @@ namespace mod_h5pactivity\privacy; -defined('MOODLE_INTERNAL') || die(); - use \core_privacy\local\request\approved_contextlist; use \core_privacy\local\request\approved_userlist; use \core_privacy\local\request\writer; diff --git a/mod/h5pactivity/tests/xapi/handler_test.php b/mod/h5pactivity/tests/xapi/handler_test.php index 68d42bb45e3..43c4eba8e42 100644 --- a/mod/h5pactivity/tests/xapi/handler_test.php +++ b/mod/h5pactivity/tests/xapi/handler_test.php @@ -35,8 +35,6 @@ use \core_xapi\local\statement\item_result; use context_module; use stdClass; -defined('MOODLE_INTERNAL') || die(); - /** * Attempt tests class for mod_h5pactivity. *