UPGRADE TESTING This tests the upgrade process with items that have groupmembersonly set, along with various relevant combinations of other restrictions. You will need an installation of Moodle that has not had this patch applied yet, and the attached backup file. U1 On your non-upgraded system, ensure that the enablegroupmembersonly experimental option is turned on, and enableactivities is turned on. U2 Restore the attached backup (group_members_only_test.mbz) to a new course. U3 Apply the Moodle upgrade. EXPECTED: Upgrade should work. You'll notice a progress bar as it updates a number of groupmembersonly activities. U4 Check the settings are as follows: 1. Page: Non-GMO No restrictions 2. Page (GMO, no other restrictions) Group required, hidden otherwise. 3. Page (GMO, grouping, no other restrictions) Must belong to Grouping 1, hidden otherwise. 4. Page (GMO, date) Date condition (1 August 2026) & any group, hidden otherwise 5. Page (GMO, 2 dates, AND) Two date conditions & any group, hidden otherwise 6. Page (GMO, 2 dates, OR) AND tree combining an OR tree (with two dates) & group, hidden otherwise 7. Page (GMO, 2 dates, NOT OR) Looks same as #5; edit settings to see that it is a NOT OR list, with an internal NOT AND set with the group condition. (I.e. the group condition is flipped twice to make it positive again.) 8. Page (GMO, 2 dates, NOT AND) Looks same as #6; edit settings to see that the original NOT AND list with two dates has now been set up as a child of an overall AND list with the group condition. BACKUP AND RESTORE TESTING (This and other testing assumes the already-upgraded system.) B1 Restore the attached backup (group_members_only_test.mbz) to a new course. Note: This backup was created from an earlier Moodle version. EXPECTED: Settings should be as above (step U3). B2 Back up this course again, then restore it to a new course. EXPECTED: No errors and settings are as above. MODULE TESTING SETUP S0 Enable availability at system level. S1 Create a new test course. S2 Enrol 5 test accounts as students. We will refer to these as u1, u2, u3, u4, and u5. S3 Create 2 groups, 'g1' and 'g2'. S4 Add users u1 and u2 to g1, and u3 and u4 to g2. S5 Create a grouping 'gg' and add g1 and g2 to it. WORKSHOP W1 Create a Workshop with default options except: - You need to fill in the name, description, and 'Instructions for submission'. - Expand 'Restrict access' and choose the Grouping gg. W2 Click on the lightbulb to set 'Submission phase'. W3 Log in as u1, u2, u3, and u4, and submit something for each. W4 Log in as admin and click on 'Allocate submissions' (left menu). EXPECTED: Only the 4 users with access should be shown, not u5. W5 Click on the 'Random allocation' tab. Choose 1 review per submission and save, then go to the manual allocation tab again to see the results. EXPECTED: The users should each be allocated to review one other user. Allocation will be at random without regard to the groups. W6 Edit settings for the Workshop. Enable 'Separate groups' mode and select the 'gg' grouping, then save and display. W7 Repeat the random allocation (using the option to remove current allocations). EXPECTED: Now the users should be allocated to review only the other user from the same group. NOTE: There are still some inconsistencies with workshop (unchanged from previous behaviour) regarding the group mode. If you turn on group mode for the workshop, this should mean that people who don't belong to those groups cannot submit anything, but in practice the workshop lets you submit anyway, and then random allocation won't work. However, at least you can now make it work correctly by also adding a restriction using 'Restrict access'. NOTE: At time of writing I see this warning from workshop when doing random allocation: "You need to update your sql to include additional name fields in the user object." line 173 of /mod/workshop/allocation/random/lib.php: call to fullname(). This is not related to the change. QUIZ Q1 Create a Quiz with default options except: - You need to fill in the name. - Expand 'Restrict access' and choose the Group g1. Q2 From the left menu, select 'User overrides'. Q3 Click 'Add user override'. EXPECTED: The 'Override user' list shows only u1 and u2, and not other users on course. Q4 Select user 1, type a password into the password box, and click 'Save'. EXPECTED: No errors. ASSIGN A1 Create an Assignment with default options except: - You need to fill in the name and description. - Expand 'Restrict access' and choose the Grouping gg. A2 Log in as u1 and submit the assignment. A3 Back as admin, from the left menu, select 'View/Grade all submissions'. EXPECTED: u1...u4 are shown in the list, but u5 is not. A4 Grade the assignment for u1 (click the 'edit' icon next to it, then type a grade and save. EXPECTED: Grade is saved without errors.