From f17cb25aabf0aed97e9fa91a59c1c38f43b8f5f0 Mon Sep 17 00:00:00 2001 From: Irina Hoppe Date: Wed, 6 Mar 2024 10:34:56 +0100 Subject: [PATCH] fix usage of mod_ratingallocate strategy namespaces --- locallib.php | 4 ++-- mod_form.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/locallib.php b/locallib.php index e83b028b..137c7c7e 100644 --- a/locallib.php +++ b/locallib.php @@ -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(); @@ -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]); 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();