diff --git a/classes/plagiarism_pchkorg_config_model.php b/classes/plagiarism_pchkorg_config_model.php index cfd7e50..6164f37 100644 --- a/classes/plagiarism_pchkorg_config_model.php +++ b/classes/plagiarism_pchkorg_config_model.php @@ -75,25 +75,20 @@ class plagiarism_pchkorg_config_model { public function get_filter_for_module($module, $name) { global $DB; - static $resultmap = array(); - // This will be called only once per module. - if (!array_key_exists($module, $resultmap)) { - $configs = $DB->get_records('plagiarism_pchkorg_config', array( - 'cm' => $module, - 'name' => $name - )); + $configs = $DB->get_records('plagiarism_pchkorg_config', array( + 'cm' => $module, + 'name' => $name, + )); - $value = null; - foreach ($configs as $record) { - if ($record->name === $name) { - $value = $record->value; - } + $value = null; + foreach ($configs as $record) { + if ($record->name === $name) { + $value = $record->value; + break; } - - $resultmap[$module] = $value; } - return $resultmap[$module]; + return $value; } /** diff --git a/version.php b/version.php index ea9fc16..6c20eec 100644 --- a/version.php +++ b/version.php @@ -26,7 +26,7 @@ defined('MOODLE_INTERNAL') || die(); if (!isset($plugin)) { $plugin = new stdClass(); } -$plugin->version = 2022050517; +$plugin->version = 2022050519; $plugin->requires = 2017051500; // Requires Moodle 3.3 . $plugin->release = 'v3.8.4'; $plugin->maturity = MATURITY_STABLE;