Show
Prerequisite
Have a student with first name "Grainne", last name "Beauchamp", middle name "Ann", alternate name "Jill" (last two settings are under "Additional names") and let that student have preferred language other than site language. E.g. the site is 'en' so choose 'fr' for example.
Have a second student with first name "Niamh", last name "Cholmondely", middle name "Jane", alternate name "Nina".
In Admin, have alternativefullnameformat set to "middlename, alternatename, firstname, lastname".
Case without Require all group members submit
In a course, enrol both students and put them into the same group.
As a teacher, create an assignment activity, set the "Students submit in groups" setting to "Yes", "Require group to make submission" to "Yes" and "Require all group members submit" to "No".
As a student, make a submission.
Verify that as the student making the submission you get a notification, and it is in french.
Verify that as a student being in the same group as the student making the submission you get a notification.
Case with Require all group members submit
As a teacher, create a second assignment activity, set the "Students submit in groups" setting to "Yes", "Require group to make submission" to "Yes" and "Require all group members submit" to "Yes".
As a student, make a submission.
Verify that as the student making the submission you get a notification.
Verify that as a student being in the same group as the student making the submission you get a notification.
Case when moodle/site:viewfullnames is given to the student role on system level (as if they were teachers)
For the 'student' role, set the capability of 'moodle/site:viewfullnames' for system level to "allow" (in Site administration → Users → Permissions → Define roles).
As a teacher, create a third assignment activity, set the "Students submit in groups" setting to "Yes", "Require group to make submission" to "Yes" and "Require all group members submit" to "No".
As a student, make a submission.
Verify that as the student making the submission you get a notification.
Verify that as a student being in the same group as the student making the submission you get a notification, and that it does contain the name of the other student in the format "middlename, alternatename, firstname, lastname".
Case when moodle/course:viewparticipants is prevented from the student role in the course (Moodle instances or courses where students have not the possibility to see other participants)
In this course, for the capability 'moodle/course:viewparticipants' either remove 'Student' from the Roles with permission or add the role 'Student' to "prevent".
As a teacher, create a fourth assignment activity, set the "Students submit in groups" setting to "Yes", "Require group to make submission" to "Yes" and "Require all group members submit" to "Yes".
As a student, make a submission.
Verify that as the student making the submission you get a notification.
Verify that as a student being in the same group as the student making the submission you get a notification, and that it does not contain the name of the other student but states "A member of your group whose name you cannot see due to your Moodle's privacy settings" and that the sender's first name and lastname states "Anonymous Anonymous".
Case with assignment group setting is set to no and course setting set to force group mode.
Reset moodle/viewparticipants:viewparticipants and 'moodle/site:viewfullnames' to the default for the student role again.
Set the course to force group mode.
As a teacher, create another assignment activity, and leave the "Students submit in groups" setting to "No".
As a student, make a submission.
Verify that as the student making the submission you get a notification.
Verify that as a student being in the same group as the student making the submission you get a notification.
This is all covered by PHPUnit tests, alongside the cases for submission copy and submission removal.