1
0
mirror of https://github.com/PlagiarismCheck/moodle-plagiarism_pchkorg.git synced 2024-12-22 04:10:07 +00:00

Fix filters for activity settings.

This commit is contained in:
Jane Adelmann 2022-05-05 17:45:40 +03:00
parent 7467fd56b9
commit 3271259e66
No known key found for this signature in database
GPG Key ID: 4CCF39DF30B8AF72
2 changed files with 11 additions and 16 deletions

View File

@ -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;
}
/**

View File

@ -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;