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
1 changed files with 3 additions and 3 deletions

View File

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