At the moment it is a bit of a pain in the backside to restrict access to an activity to one or more groups. This is possible via the grouping feature but the user interface to create a groupingis tedious and is especially annoying if you only really want to restrict an activity to one group. See
I propose there should be an easier way to create a grouping as follows:
- Where we currently have the groupings dropdown, add a Select one or more groups button right next to it. The button should appear only if you have the necessary permissions to create groupings (you probably do if you are editing an activity).
- If you choose that button, you get an in-page popup titled Create grouping containing a list of all the groups on the course (populated by AJAX request).
- You can click to select one group or ctrl-click to select several of them (i.e. a standard list).
- There's a text box at the top where you can give the grouping a name, which defaults to [Activity name] grouping (taking the name from the form field rather than from the database, so that it works even if the activity hasn't been created yet or if the user is midway through changing the name).
- Click OK and it creates the grouping and updates the list in the dropdown (via AJAX request), and selects it.
Once this feature is in place the procedure for restricting a single resource/activity to a single group, when editing the activity settings, would then become:
1. By the grouping dropdown, click Select one or more groups button.
2. Click on the group you want to restrict it to.
3. Click OK.
Some details added later:
Q: When a grouping is already selected, and you click the button, what happens?
A: The AJAX request mentioned should pull the initial selection state for the list of groups, and the grouping name, from the selected grouping. So you can use this to edit the existing grouping as well as create one for the first time.
Q: What happens if you create a grouping with a name that already exists (as would happen, for example, if you edit a grouping as above)?
A: If the grouping with the same name is not assigned to any other activity, then when you click OK the grouping is updated to the newly-selected list of groups without a prompt. If the grouping is assigned to any other activities then you get a popup confirm prompt with wording like (but not exactly, because this is horrid) 'This change will also affect the following activities. If you don't want that to happen, click cancel' with a list of activities.
As a consequence of this, here is another simple use case: if you already created an activity using this button, then you later edit the activity and want to change the list of groups, here is how (from the activity settings page)
1. By the grouping dropdown, click Select one or more groups button. The list will pop up with the currently-selected group(s) showing.
2. Click on the different groups you now want to restrict it to.
3. Click OK.