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

Update lib.php "Support student custom roles" (#29)

Rollback 8862dc0
This commit is contained in:
Llewelyn Williams 2023-06-06 09:44:56 +01:00 committed by GitHub
parent 8862dc050a
commit 87f8af6563
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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