diff --git a/backup/moodle2/backup_ratingallocate_activity_stepslib.php b/backup/moodle2/backup_ratingallocate_activity_stepslib.php index 3ebd04fd..b682791f 100644 --- a/backup/moodle2/backup_ratingallocate_activity_stepslib.php +++ b/backup/moodle2/backup_ratingallocate_activity_stepslib.php @@ -18,7 +18,7 @@ require_once(dirname(__FILE__) . '/backup_restore_helper.php'); -use ratingallocate\db as this_db; +use mod_ratingallocate\db as this_db; /** * Define the complete ratingallocate structure for backup, with [file and] id annotations @@ -35,38 +35,38 @@ protected function define_structure() { $userinfo = $this->get_setting_value('userinfo'); // Define each element separated. - $class = 'ratingallocate\db\ratingallocate'; + $class = 'mod_ratingallocate\db\ratingallocate'; $ratingallocate = new backup_nested_element(get_tablename_for_tableClass($class), get_id_for_tableClass($class), get_fields_for_tableClass($class)); - $class = 'ratingallocate\db\ratingallocate_choices'; + $class = 'mod_ratingallocate\db\ratingallocate_choices'; $ratingallocatechoices = new backup_nested_element(get_tablename_for_tableClass($class) . 's'); $ratingallocatechoice = new backup_nested_element(get_tablename_for_tableClass($class), get_id_for_tableClass($class), get_fields_for_tableClass($class)); - $class = 'ratingallocate\db\ratingallocate_ratings'; + $class = 'mod_ratingallocate\db\ratingallocate_ratings'; $ratingallocateratings = new backup_nested_element(get_tablename_for_tableClass($class) . 's'); $ratingallocaterating = new backup_nested_element(get_tablename_for_tableClass($class), get_id_for_tableClass($class), get_fields_for_tableClass($class)); - $class = 'ratingallocate\db\ratingallocate_allocations'; + $class = 'mod_ratingallocate\db\ratingallocate_allocations'; $ratingallocateallocations = new backup_nested_element(get_tablename_for_tableClass($class) . 's'); $ratingallocateallocation = new backup_nested_element(get_tablename_for_tableClass($class), get_id_for_tableClass($class), get_fields_for_tableClass($class)); - $groupchoiceclass = 'ratingallocate\db\ratingallocate_group_choices'; + $groupchoiceclass = 'mod_ratingallocate\db\ratingallocate_group_choices'; $groupchoices = new backup_nested_element(get_tablename_for_tableClass($groupchoiceclass) . 's'); $groupchoice = new backup_nested_element(get_tablename_for_tableClass($groupchoiceclass), get_id_for_tableClass($groupchoiceclass), get_fields_for_tableClass($groupchoiceclass)); - $choicegroupclass = 'ratingallocate\db\ratingallocate_ch_gengroups'; + $choicegroupclass = 'mod_ratingallocate\db\ratingallocate_ch_gengroups'; $ratingallocatechoicegroups = new backup_nested_element(get_tablename_for_tableClass($choicegroupclass) . 's'); $ratingallocatechoicegroup = new backup_nested_element(get_tablename_for_tableClass($choicegroupclass), get_id_for_tableClass($choicegroupclass), get_fields_for_tableClass($choicegroupclass)); - $groupingclass = 'ratingallocate\db\ratingallocate_groupings'; + $groupingclass = 'mod_ratingallocate\db\ratingallocate_groupings'; $ratingallocategroupings = new backup_nested_element(get_tablename_for_tableClass($groupingclass) . 's'); $ratingallocategrouping = new backup_nested_element(get_tablename_for_tableClass($groupingclass), get_id_for_tableClass($groupingclass), @@ -92,9 +92,9 @@ protected function define_structure() { $ratingallocatechoicegroups->add_child($ratingallocatechoicegroup); // Define sources. - $ratingallocate->set_source_table(get_tablename_for_tableClass('ratingallocate\db\ratingallocate'), + $ratingallocate->set_source_table(get_tablename_for_tableClass('mod_ratingallocate\db\ratingallocate'), array(this_db\ratingallocate::ID => backup::VAR_ACTIVITYID), this_db\ratingallocate_choices::ID . ' ASC'); - $ratingallocatechoice->set_source_table(get_tablename_for_tableClass('ratingallocate\db\ratingallocate_choices'), + $ratingallocatechoice->set_source_table(get_tablename_for_tableClass('mod_ratingallocate\db\ratingallocate_choices'), array(this_db\ratingallocate_choices::RATINGALLOCATEID => backup::VAR_PARENTID), this_db\ratingallocate_choices::ID . ' ASC'); $groupchoice->set_source_table(get_tablename_for_tableClass($groupchoiceclass), ['choiceid' => backup::VAR_PARENTID]); @@ -105,11 +105,11 @@ protected function define_structure() { if ($userinfo) { $ratingallocaterating->set_source_table(get_tablename_for_tableClass( - 'ratingallocate\db\ratingallocate_ratings'), + 'mod_ratingallocate\db\ratingallocate_ratings'), array(this_db\ratingallocate_ratings::CHOICEID => backup::VAR_PARENTID), this_db\ratingallocate_ratings::ID . ' ASC'); $ratingallocateallocation->set_source_table( - get_tablename_for_tableClass('ratingallocate\db\ratingallocate_allocations'), + get_tablename_for_tableClass('mod_ratingallocate\db\ratingallocate_allocations'), array( this_db\ratingallocate_allocations::RATINGALLOCATEID => backup::VAR_ACTIVITYID, this_db\ratingallocate_allocations::CHOICEID => backup::VAR_PARENTID), diff --git a/backup/moodle2/restore_ratingallocate_activity_stepslib.php b/backup/moodle2/restore_ratingallocate_activity_stepslib.php index d27aa25c..d89b4437 100644 --- a/backup/moodle2/restore_ratingallocate_activity_stepslib.php +++ b/backup/moodle2/restore_ratingallocate_activity_stepslib.php @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -use ratingallocate\db as this_db; +use mod_ratingallocate\db as this_db; /** * diff --git a/classes/choice_importer.php b/classes/choice_importer.php index d7a3fb33..cd80e9c2 100644 --- a/classes/choice_importer.php +++ b/classes/choice_importer.php @@ -21,7 +21,7 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_ratingallocate; -use ratingallocate\db as this_db; +use mod_ratingallocate\db as this_db; defined('MOODLE_INTERNAL') || die(); diff --git a/classes/task/cron_task.php b/classes/task/cron_task.php index c91ded43..aca7c3a1 100644 --- a/classes/task/cron_task.php +++ b/classes/task/cron_task.php @@ -16,7 +16,7 @@ namespace mod_ratingallocate\task; -use ratingallocate\db as this_db; +use mod_ratingallocate\db as this_db; defined('MOODLE_INTERNAL') || die(); diff --git a/classes/task/send_distribution_notification.php b/classes/task/send_distribution_notification.php index 2913ef0c..2a70360b 100644 --- a/classes/task/send_distribution_notification.php +++ b/classes/task/send_distribution_notification.php @@ -26,7 +26,7 @@ require_once(dirname(__FILE__) . '/../../db/db_structure.php'); -use ratingallocate\db as this_db; +use mod_ratingallocate\db as this_db; class send_distribution_notification extends \core\task\adhoc_task { // Gets executed by the task runner. Will lookup the ratingallocation object and diff --git a/db/db_structure.php b/db/db_structure.php index 1095c0e7..2c3959a7 100644 --- a/db/db_structure.php +++ b/db/db_structure.php @@ -23,7 +23,7 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -namespace ratingallocate\db; +namespace mod_ratingallocate\db; defined('MOODLE_INTERNAL') || die(); class ratingallocate { diff --git a/lib.php b/lib.php index f622777a..c1bed7d3 100644 --- a/lib.php +++ b/lib.php @@ -41,7 +41,7 @@ require_once(dirname(__FILE__) . '/db/db_structure.php'); -use ratingallocate\db as this_db; +use mod_ratingallocate\db as this_db; // ////////////////////////////////////////////////////////////////////////////// // Moodle core API // diff --git a/locallib.php b/locallib.php index 615d0e70..137c7c7e 100644 --- a/locallib.php +++ b/locallib.php @@ -29,7 +29,7 @@ use core_availability\info_module; use mod_ratingallocate\task\distribute_unallocated_task; -use ratingallocate\db as this_db; +use mod_ratingallocate\db as this_db; global $CFG; @@ -328,7 +328,7 @@ private function process_action_give_rating() { // Rating is possible... // Suche das richtige Formular nach Strategie. - $strategyform = 'ratingallocate\\' . $this->ratingallocate->strategy . '\\mod_ratingallocate_view_form'; + $strategyform = 'mod_ratingallocate\\' . $this->ratingallocate->strategy . '\\mod_ratingallocate_view_form'; $mform = new $strategyform($PAGE->url->out(), $this); $mform->add_action_buttons(); @@ -396,9 +396,9 @@ private function process_action_show_choices() { // Notifications if no choices exist or too few in comparison to strategy settings. $availablechoices = $this->get_rateable_choices(); $strategysettings = $this->get_strategy_class()->get_static_settingfields(); - if (array_key_exists(ratingallocate\strategy_order\strategy::COUNTOPTIONS, $strategysettings)) { + if (array_key_exists(mod_ratingallocate\strategy_order\strategy::COUNTOPTIONS, $strategysettings)) { $necessarychoices = - $strategysettings[ratingallocate\strategy_order\strategy::COUNTOPTIONS][2]; + $strategysettings[mod_ratingallocate\strategy_order\strategy::COUNTOPTIONS][2]; } else { $necessarychoices = 0; } @@ -1213,9 +1213,9 @@ public function handle_view() { $choicestatus->availablechoices = $this->filter_choices_by_groups($choicestatus->availablechoices, $USER->id); $strategysettings = $this->get_strategy_class()->get_static_settingfields(); - if (array_key_exists(ratingallocate\strategy_order\strategy::COUNTOPTIONS, $strategysettings)) { + if (array_key_exists(mod_ratingallocate\strategy_order\strategy::COUNTOPTIONS, $strategysettings)) { $choicestatus->necessarychoices = - $strategysettings[ratingallocate\strategy_order\strategy::COUNTOPTIONS][2]; + $strategysettings[mod_ratingallocate\strategy_order\strategy::COUNTOPTIONS][2]; } else { $choicestatus->necessarychoices = 0; } @@ -2047,7 +2047,7 @@ public function get_options_titles(array $ratings) { * Returns the strategy class for the ratingallocate */ private function get_strategy_class() { - $strategyclassp = 'ratingallocate\\' . $this->ratingallocate->strategy . '\\strategy'; + $strategyclassp = 'mod_ratingallocate\\' . $this->ratingallocate->strategy . '\\strategy'; $allsettings = json_decode($this->ratingallocate->setting, true); if (array_key_exists($this->ratingallocate->strategy, $allsettings)) { return new $strategyclassp($allsettings[$this->ratingallocate->strategy]); @@ -2197,7 +2197,7 @@ public function is_setup_ok() { $choicecount = count($this->get_rateable_choices()); $strategyclass = $this->get_strategy_class(); $strategysettings = $strategyclass->get_static_settingfields(); - $necessarychoices = $strategysettings[ratingallocate\strategy_order\strategy::COUNTOPTIONS][2]; + $necessarychoices = $strategysettings[mod_ratingallocate\strategy_order\strategy::COUNTOPTIONS][2]; if ($choicecount < $necessarychoices) { return false; } diff --git a/mod_form.php b/mod_form.php index 61f3099e..45adb8bf 100644 --- a/mod_form.php +++ b/mod_form.php @@ -126,7 +126,7 @@ public function definition() { foreach (\strategymanager::get_strategies() as $strategy) { // Load strategy class. - $strategyclassp = 'ratingallocate\\' . $strategy . '\\strategy'; + $strategyclassp = 'mod_ratingallocate\\' . $strategy . '\\strategy'; $strategyclass = new $strategyclassp(); // Add options fields. @@ -218,7 +218,7 @@ public function definition_after_data() { // Add dynamic settings fields. foreach (\strategymanager::get_strategies() as $strategy) { // Load strategy class. - $strategyclassp = 'ratingallocate\\' . $strategy . '\\strategy'; + $strategyclassp = 'mod_ratingallocate\\' . $strategy . '\\strategy'; if (isset($allstrategyoptions) && array_key_exists($strategy, $allstrategyoptions)) { $strategyclass = new $strategyclassp($allstrategyoptions[$strategy]); } else { @@ -276,7 +276,7 @@ public function validation($data, $files) { // User has to select one strategy. $errors['strategy'] = get_string('strategy_not_specified', self::MOD_NAME); } else { - $strategyclassp = 'ratingallocate\\' . $data['strategy'] . '\\strategy'; + $strategyclassp = 'mod_ratingallocate\\' . $data['strategy'] . '\\strategy'; if (array_key_exists($data['strategy'], $data['strategyopt'])) { $strategyclass = new $strategyclassp($data['strategyopt'][$data['strategy']]); $settingerrors = $strategyclass->validate_settings(); diff --git a/renderer.php b/renderer.php index a792df32..aa270ba4 100644 --- a/renderer.php +++ b/renderer.php @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -use ratingallocate\db as this_db; +use mod_ratingallocate\db as this_db; defined('MOODLE_INTERNAL') || die(); diff --git a/strategy/strategy01_yes_no.php b/strategy/strategy01_yes_no.php index a05c26e2..e8328f43 100644 --- a/strategy/strategy01_yes_no.php +++ b/strategy/strategy01_yes_no.php @@ -26,7 +26,7 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -namespace ratingallocate\strategy_yesno; +namespace mod_ratingallocate\strategy_yesno; defined('MOODLE_INTERNAL') || die(); require_once($CFG->libdir . '/formslib.php'); diff --git a/strategy/strategy02_yes_maybe_no.php b/strategy/strategy02_yes_maybe_no.php index 05a57377..226f0a37 100644 --- a/strategy/strategy02_yes_maybe_no.php +++ b/strategy/strategy02_yes_maybe_no.php @@ -27,7 +27,7 @@ */ // Namespace is mandatory! -namespace ratingallocate\strategy_yesmaybeno; +namespace mod_ratingallocate\strategy_yesmaybeno; defined('MOODLE_INTERNAL') || die(); require_once($CFG->libdir . '/formslib.php'); diff --git a/strategy/strategy03_lickert.php b/strategy/strategy03_lickert.php index 8f750ff0..cff271cc 100644 --- a/strategy/strategy03_lickert.php +++ b/strategy/strategy03_lickert.php @@ -26,7 +26,7 @@ */ // Namespace is mandatory! -namespace ratingallocate\strategy_lickert; +namespace mod_ratingallocate\strategy_lickert; defined('MOODLE_INTERNAL') || die(); require_once($CFG->libdir . '/formslib.php'); diff --git a/strategy/strategy04_points.php b/strategy/strategy04_points.php index 7e93b0d0..33b58249 100644 --- a/strategy/strategy04_points.php +++ b/strategy/strategy04_points.php @@ -27,7 +27,7 @@ */ // Namespace is mandatory! -namespace ratingallocate\strategy_points; +namespace mod_ratingallocate\strategy_points; defined('MOODLE_INTERNAL') || die(); require_once($CFG->libdir . '/formslib.php'); diff --git a/strategy/strategy05_order.php b/strategy/strategy05_order.php index 54f4f26a..6abc6cc4 100644 --- a/strategy/strategy05_order.php +++ b/strategy/strategy05_order.php @@ -26,7 +26,7 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ // Namespace is mandatory! -namespace ratingallocate\strategy_order; +namespace mod_ratingallocate\strategy_order; defined('MOODLE_INTERNAL') || die(); require_once($CFG->libdir . '/formslib.php'); diff --git a/strategy/strategy06_tickyes.php b/strategy/strategy06_tickyes.php index 45fe1f44..23d243fb 100644 --- a/strategy/strategy06_tickyes.php +++ b/strategy/strategy06_tickyes.php @@ -27,7 +27,7 @@ */ // Namespace is mandatory! -namespace ratingallocate\strategy_tickyes; +namespace mod_ratingallocate\strategy_tickyes; defined('MOODLE_INTERNAL') || die(); require_once($CFG->libdir . '/formslib.php'); diff --git a/tests/backup_restore_test.php b/tests/backup_restore_test.php index b7ed3def..5e91b123 100644 --- a/tests/backup_restore_test.php +++ b/tests/backup_restore_test.php @@ -24,7 +24,7 @@ require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php'); require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php'); -use ratingallocate\db as this_db; +use mod_ratingallocate\db as this_db; /** * mod_ratingallocate backup restore procedure test diff --git a/tests/cron_test.php b/tests/cron_test.php index 40a8880c..6be4c450 100644 --- a/tests/cron_test.php +++ b/tests/cron_test.php @@ -20,7 +20,7 @@ require_once(__DIR__ . '/generator/lib.php'); require_once(__DIR__ . '/../locallib.php'); -use ratingallocate\db as this_db; +use mod_ratingallocate\db as this_db; /** * mod_ratingallocate cron tests diff --git a/tests/generator/lib.php b/tests/generator/lib.php index 76fba82a..b195d634 100644 --- a/tests/generator/lib.php +++ b/tests/generator/lib.php @@ -18,7 +18,7 @@ require_once(dirname(__FILE__) . '/../../locallib.php'); -use ratingallocate\db as this_db; +use mod_ratingallocate\db as this_db; /** * mod_ratinallocate generator tests diff --git a/tests/locallib_test.php b/tests/locallib_test.php index 789ec24c..a6322f5e 100644 --- a/tests/locallib_test.php +++ b/tests/locallib_test.php @@ -20,7 +20,7 @@ require_once(dirname(__FILE__) . '/generator/lib.php'); require_once(dirname(__FILE__) . '/../locallib.php'); -use ratingallocate\db as this_db; +use mod_ratingallocate\db as this_db; /** * mod_ratingallocate generator tests diff --git a/tests/mod_ratingallocate_strategy_test.php b/tests/mod_ratingallocate_strategy_test.php index 52305f2c..8b950f86 100644 --- a/tests/mod_ratingallocate_strategy_test.php +++ b/tests/mod_ratingallocate_strategy_test.php @@ -32,16 +32,16 @@ class mod_ratingallocate_strategy_test extends \advanced_testcase { */ public function test_yes_no_validation() { // Attribute required. - $settings = array(\ratingallocate\strategy_yesno\strategy::MAXCROSSOUT => null); - $strategy = new \ratingallocate\strategy_yesno\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_yesno\strategy::MAXCROSSOUT => null); + $strategy = new \mod_ratingallocate\strategy_yesno\strategy($settings); $this->assertCount(1, $strategy->validate_settings()); // Attribute minimum error. - $settings = array(\ratingallocate\strategy_yesno\strategy::MAXCROSSOUT => -1); - $strategy = new \ratingallocate\strategy_yesno\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_yesno\strategy::MAXCROSSOUT => -1); + $strategy = new \mod_ratingallocate\strategy_yesno\strategy($settings); $this->assertCount(1, $strategy->validate_settings()); // No validation error. - $settings = array(\ratingallocate\strategy_yesno\strategy::MAXCROSSOUT => 1); - $strategy = new \ratingallocate\strategy_yesno\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_yesno\strategy::MAXCROSSOUT => 1); + $strategy = new \mod_ratingallocate\strategy_yesno\strategy($settings); $this->assertCount(0, $strategy->validate_settings()); } @@ -50,16 +50,16 @@ public function test_yes_no_validation() { */ public function test_yes_maybe_no_validation() { // Attribute required. - $settings = array(\ratingallocate\strategy_yesmaybeno\strategy::MAXNO => null); - $strategy = new \ratingallocate\strategy_yesmaybeno\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_yesmaybeno\strategy::MAXNO => null); + $strategy = new \mod_ratingallocate\strategy_yesmaybeno\strategy($settings); $this->assertCount(1, $strategy->validate_settings()); // Attribute minimum error. - $settings = array(\ratingallocate\strategy_yesmaybeno\strategy::MAXNO => -1); - $strategy = new \ratingallocate\strategy_yesmaybeno\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_yesmaybeno\strategy::MAXNO => -1); + $strategy = new \mod_ratingallocate\strategy_yesmaybeno\strategy($settings); $this->assertCount(1, $strategy->validate_settings()); // No validation error. - $settings = array(\ratingallocate\strategy_yesmaybeno\strategy::MAXNO => 1); - $strategy = new \ratingallocate\strategy_yesmaybeno\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_yesmaybeno\strategy::MAXNO => 1); + $strategy = new \mod_ratingallocate\strategy_yesmaybeno\strategy($settings); $this->assertCount(0, $strategy->validate_settings()); } @@ -68,28 +68,28 @@ public function test_yes_maybe_no_validation() { */ public function test_lickert_validation() { // Attribute required. - $settings = array(\ratingallocate\strategy_lickert\strategy::COUNTLICKERT => null); - $strategy = new \ratingallocate\strategy_lickert\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_lickert\strategy::COUNTLICKERT => null); + $strategy = new \mod_ratingallocate\strategy_lickert\strategy($settings); $this->assertCount(1, $strategy->validate_settings()); // Attribute required. - $settings = array(\ratingallocate\strategy_lickert\strategy::MAXNO => null); - $strategy = new \ratingallocate\strategy_lickert\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_lickert\strategy::MAXNO => null); + $strategy = new \mod_ratingallocate\strategy_lickert\strategy($settings); $this->assertCount(1, $strategy->validate_settings()); // Attribute minimum error. - $settings = array(\ratingallocate\strategy_lickert\strategy::COUNTLICKERT => 1); - $strategy = new \ratingallocate\strategy_lickert\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_lickert\strategy::COUNTLICKERT => 1); + $strategy = new \mod_ratingallocate\strategy_lickert\strategy($settings); $this->assertCount(1, $strategy->validate_settings()); // Attribute minimum error. - $settings = array(\ratingallocate\strategy_lickert\strategy::MAXNO => -1); - $strategy = new \ratingallocate\strategy_lickert\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_lickert\strategy::MAXNO => -1); + $strategy = new \mod_ratingallocate\strategy_lickert\strategy($settings); $this->assertCount(1, $strategy->validate_settings()); // No validation error. - $settings = array(\ratingallocate\strategy_lickert\strategy::COUNTLICKERT => 3); - $strategy = new \ratingallocate\strategy_lickert\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_lickert\strategy::COUNTLICKERT => 3); + $strategy = new \mod_ratingallocate\strategy_lickert\strategy($settings); $this->assertCount(0, $strategy->validate_settings()); // No validation error. - $settings = array(\ratingallocate\strategy_lickert\strategy::MAXNO => 1); - $strategy = new \ratingallocate\strategy_lickert\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_lickert\strategy::MAXNO => 1); + $strategy = new \mod_ratingallocate\strategy_lickert\strategy($settings); $this->assertCount(0, $strategy->validate_settings()); } @@ -98,40 +98,40 @@ public function test_lickert_validation() { */ public function test_points_validation() { // Attribute required. - $settings = array(\ratingallocate\strategy_points\strategy::MAXZERO => null); - $strategy = new \ratingallocate\strategy_points\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_points\strategy::MAXZERO => null); + $strategy = new \mod_ratingallocate\strategy_points\strategy($settings); $this->assertCount(1, $strategy->validate_settings()); // Attribute required. - $settings = array(\ratingallocate\strategy_points\strategy::TOTALPOINTS => null); - $strategy = new \ratingallocate\strategy_points\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_points\strategy::TOTALPOINTS => null); + $strategy = new \mod_ratingallocate\strategy_points\strategy($settings); $this->assertCount(1, $strategy->validate_settings()); // Attribute required. - $settings = array(\ratingallocate\strategy_points\strategy::MAXPERCHOICE => null); - $strategy = new \ratingallocate\strategy_points\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_points\strategy::MAXPERCHOICE => null); + $strategy = new \mod_ratingallocate\strategy_points\strategy($settings); $this->assertCount(1, $strategy->validate_settings()); // Attribute minimum error. - $settings = array(\ratingallocate\strategy_points\strategy::MAXZERO => -1); - $strategy = new \ratingallocate\strategy_points\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_points\strategy::MAXZERO => -1); + $strategy = new \mod_ratingallocate\strategy_points\strategy($settings); $this->assertCount(1, $strategy->validate_settings()); // Attribute minimum error. - $settings = array(\ratingallocate\strategy_points\strategy::TOTALPOINTS => 0); - $strategy = new \ratingallocate\strategy_points\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_points\strategy::TOTALPOINTS => 0); + $strategy = new \mod_ratingallocate\strategy_points\strategy($settings); $this->assertCount(1, $strategy->validate_settings()); // Attribute minimum error. - $settings = array(\ratingallocate\strategy_points\strategy::MAXPERCHOICE => 0); - $strategy = new \ratingallocate\strategy_points\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_points\strategy::MAXPERCHOICE => 0); + $strategy = new \mod_ratingallocate\strategy_points\strategy($settings); $this->assertCount(1, $strategy->validate_settings()); // No validation error. - $settings = array(\ratingallocate\strategy_points\strategy::MAXZERO => 0); - $strategy = new \ratingallocate\strategy_points\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_points\strategy::MAXZERO => 0); + $strategy = new \mod_ratingallocate\strategy_points\strategy($settings); $this->assertCount(0, $strategy->validate_settings()); // No validation error. - $settings = array(\ratingallocate\strategy_points\strategy::TOTALPOINTS => 1); - $strategy = new \ratingallocate\strategy_points\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_points\strategy::TOTALPOINTS => 1); + $strategy = new \mod_ratingallocate\strategy_points\strategy($settings); $this->assertCount(0, $strategy->validate_settings()); // No validation error. - $settings = array(\ratingallocate\strategy_points\strategy::MAXPERCHOICE => 1); - $strategy = new \ratingallocate\strategy_points\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_points\strategy::MAXPERCHOICE => 1); + $strategy = new \mod_ratingallocate\strategy_points\strategy($settings); $this->assertCount(0, $strategy->validate_settings()); } @@ -140,16 +140,16 @@ public function test_points_validation() { */ public function test_order_validation() { // Attribute required. - $settings = array(\ratingallocate\strategy_order\strategy::COUNTOPTIONS => null); - $strategy = new \ratingallocate\strategy_order\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_order\strategy::COUNTOPTIONS => null); + $strategy = new \mod_ratingallocate\strategy_order\strategy($settings); $this->assertCount(1, $strategy->validate_settings()); // Attribute minimum error. - $settings = array(\ratingallocate\strategy_order\strategy::COUNTOPTIONS => 0); - $strategy = new \ratingallocate\strategy_order\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_order\strategy::COUNTOPTIONS => 0); + $strategy = new \mod_ratingallocate\strategy_order\strategy($settings); $this->assertCount(1, $strategy->validate_settings()); // No validation error. - $settings = array(\ratingallocate\strategy_order\strategy::COUNTOPTIONS => 1); - $strategy = new \ratingallocate\strategy_order\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_order\strategy::COUNTOPTIONS => 1); + $strategy = new \mod_ratingallocate\strategy_order\strategy($settings); $this->assertCount(0, $strategy->validate_settings()); } @@ -158,16 +158,16 @@ public function test_order_validation() { */ public function test_tickyes_validation() { // Attribute required. - $settings = array(\ratingallocate\strategy_tickyes\strategy::MINTICKYES => null); - $strategy = new \ratingallocate\strategy_tickyes\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_tickyes\strategy::MINTICKYES => null); + $strategy = new \mod_ratingallocate\strategy_tickyes\strategy($settings); $this->assertCount(1, $strategy->validate_settings()); // Attribute minimum error. - $settings = array(\ratingallocate\strategy_tickyes\strategy::MINTICKYES => 0); - $strategy = new \ratingallocate\strategy_tickyes\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_tickyes\strategy::MINTICKYES => 0); + $strategy = new \mod_ratingallocate\strategy_tickyes\strategy($settings); $this->assertCount(1, $strategy->validate_settings()); // No validation error. - $settings = array(\ratingallocate\strategy_tickyes\strategy::MINTICKYES => 1); - $strategy = new \ratingallocate\strategy_tickyes\strategy($settings); + $settings = array(\mod_ratingallocate\strategy_tickyes\strategy::MINTICKYES => 1); + $strategy = new \mod_ratingallocate\strategy_tickyes\strategy($settings); $this->assertCount(0, $strategy->validate_settings()); }