Compare commits

...

2 Commits

Author SHA1 Message Date
Jane Adelmann a46f7043e5
Version v3.13.5 2023-06-06 11:53:05 +03:00
Llewelyn Williams 87f8af6563
Update lib.php "Support student custom roles" (#29)
Rollback 8862dc0
2023-06-06 11:44:56 +03:00
2 changed files with 5 additions and 5 deletions

View File

@ -329,7 +329,8 @@ class plagiarism_plugin_pchkorg extends plagiarism_plugin {
$roles[] = strtolower($rolesData->shortname); $roles[] = strtolower($rolesData->shortname);
} }
// Moodle has multiple roles in courses. // Moodle has multiple roles in courses.
$isstudent = !in_array('teacher', $roles) $isstudent = in_array('student', $roles)
&& !in_array('teacher', $roles)
&& !in_array('editingteacher', $roles) && !in_array('editingteacher', $roles)
&& !in_array('managerteacher', $roles); && !in_array('managerteacher', $roles);
@ -742,8 +743,7 @@ display: inline-block;"
$roles[] = strtolower($rolesData->shortname); $roles[] = strtolower($rolesData->shortname);
} }
// Moodle has multiple roles in courses. // Moodle has multiple roles in courses.
$isstudent = in_array('student', $roles) $isstudent = !in_array('teacher', $roles)
&& !in_array('teacher', $roles)
&& !in_array('editingteacher', $roles) && !in_array('editingteacher', $roles)
&& !in_array('managerteacher', $roles); && !in_array('managerteacher', $roles);
$isregistered = $apiprovider->auto_registrate_member($name, $USER->email, $isstudent ? 3 : 2); $isregistered = $apiprovider->auto_registrate_member($name, $USER->email, $isstudent ? 3 : 2);

View File

@ -26,9 +26,9 @@ defined('MOODLE_INTERNAL') || die();
if (!isset($plugin)) { if (!isset($plugin)) {
$plugin = new stdClass(); $plugin = new stdClass();
} }
$plugin->version = 2023050117; $plugin->version = 2023060611;
$plugin->requires = 2020061501; // Requires Moodle 3.9 . $plugin->requires = 2020061501; // Requires Moodle 3.9 .
$plugin->release = 'v3.13.4'; $plugin->release = 'v3.13.5';
$plugin->component = 'plagiarism_pchkorg'; $plugin->component = 'plagiarism_pchkorg';
$plugin->maturity = MATURITY_STABLE; $plugin->maturity = MATURITY_STABLE;
$plugin->dependencies = array( $plugin->dependencies = array(