Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-44692

Assign: Remove use of groupmembersonly from new API

XMLWordPrintable

    • MOODLE_27_STABLE
    • MDL-44692-master
    • Hide

      MAIN TEST

      1. Create a new course and enrol 3 test users as students.
      2. Create 2 new groups, A and B. Add test user 1 to group A and test user 2 to group B. User 3 is not in a group.
      3. Create a new grouping. Add group A to the grouping. (Group B is not in a grouping.)
      4. Create a new Assign on the course with default settings.
      5. Go to the 'View/grade all submissions' page.

      EXPECTED: All 3 students should be shown.

      6. Edit assign settings and tick the new 'Show group members only' setting (last thing on the page), then re-check the 'All submissions' page.

      EXPECTED: Only users 1 and 2 should be shown.

      7. Edit settings and select the grouping, then recheck the page.

      EXPECTED: Only user 1 should be shown

      8. On user enrolment screen, add user 3 to teacher role, then recheck screen.

      EXPECTED: Users 1 and 3 should now be shown.

      UPGRADE TEST

      Not sure if an upgrade test is required as it may be a pain to do! I did this one though:

      1. Create a course and add two assign modules 'GMO' and 'non-GMO'. For 'GMO', set the 'Group members only' checkbox.
      2. Do the upgrade.
      3. Check settings of both activities.

      EXPECTED: The 'Show group members only' checkbox should be set to the same value as 'Group members only' (on for GMO, off for non-GMO).

      Note: the 'Group members only' option will be replaced by a different interface in future, but 'Show group members only' will remain.

      Show
      MAIN TEST 1. Create a new course and enrol 3 test users as students. 2. Create 2 new groups, A and B. Add test user 1 to group A and test user 2 to group B. User 3 is not in a group. 3. Create a new grouping. Add group A to the grouping. (Group B is not in a grouping.) 4. Create a new Assign on the course with default settings. 5. Go to the 'View/grade all submissions' page. EXPECTED: All 3 students should be shown. 6. Edit assign settings and tick the new 'Show group members only' setting (last thing on the page), then re-check the 'All submissions' page. EXPECTED: Only users 1 and 2 should be shown. 7. Edit settings and select the grouping, then recheck the page. EXPECTED: Only user 1 should be shown 8. On user enrolment screen, add user 3 to teacher role, then recheck screen. EXPECTED: Users 1 and 3 should now be shown. UPGRADE TEST Not sure if an upgrade test is required as it may be a pain to do! I did this one though: 1. Create a course and add two assign modules 'GMO' and 'non-GMO'. For 'GMO', set the 'Group members only' checkbox. 2. Do the upgrade. 3. Check settings of both activities. EXPECTED: The 'Show group members only' checkbox should be set to the same value as 'Group members only' (on for GMO, off for non-GMO). Note: the 'Group members only' option will be replaced by a different interface in future, but 'Show group members only' will remain.

      A new API function groups_filter_users_by_course_module_visible was added in MDL-43721.

      This function does not do quite what the name suggests; there are a number of ways in which a course-module can be invisible to users, but those users will still be listed. However, one of the things it does do is use the groupmembersonly option, which is being removed and incorporated into a general availability system by MDL-44070.

      I propose one of the following changes to the function:

      1) Remove the restriction based on groups and show users regardless of groups; the groupmembersonly function was always in 'experimental settings' so it should be legitimate to make it stop having this behaviour.

      or, preferably (imo)

      2) Change the restriction so that instead of using groupmembersonly it uses group mode - i.e. if the activity is set to separate groups (possibly also visible groups?), then it will only show users in those groups, otherwise it shows all users.

      There is a third less good option:

      3) I implement a hack in the new availability system so that we can obtain (quickly) information about only group and grouping restrictions for all users, achieving directly equivalent results - i.e. this will still work the same for existing uses of groupmembersonly, but will not handle other conditions. I think this is less consistent than 2 above.

      In MDL-43721 Damyon argued that the new availability system should include a way to quickly obtain a list of the users who can access an activity. While this is indeed desirable it is not possible without rewriting the rest of the way Moodle handles access (unrelated to the new availability system) - that's probably why the existing groups_filter_users_by_course_module_visible function does not do this either! I don't see why it should be a requirement for the new availability system.

      I will submit a commit that makes change (2) however this may be controversial it seems.

            quen Sam Marshall
            quen Sam Marshall
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.