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

Allow students to enrol themselves into groups with limits on max users per group

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.9, 2.7, 2.8
    • Fix Version/s: FRONTEND, BACKEND
    • Component/s: Groups
    • Labels:
    • Environment:
      any
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE

      Description

      Requirements:

      1. students can enrol themselves into groups (not by the teacher as in standard moodle)
      2. The teacher can configure a max. number of group members in the group settings

      The attached ZIP-File contains
      1. a PDF with the presentation of this features at the Moodlemoot 2008 in March in Heidelberg/Germany
      2. new files which have to be added to a standard moodle installation
      3. the diffs <original file> versus <modified file> for the files modified

      @Martin Dougiamas: We talked about this modifications at the conference, and you asked me to put them in the bug tracker.
      Here it is! It was great to meet you in Heidelberg!

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            skodak Petr Skoda added a comment -

            Thanks for the report and patch, I looked at the code a bit already.

            I would personally prefer if it was implemented as separate module similar to current choice. The problem is we need much more settings for various different scenarios and there is no place for that in course table and I do not think we should add more stuff into that anyway. Ideally it should be possible to distribute students into groups from selected grouping, which means you need several different groups selections in one course. Current module framework should be suitable for this task and there would be no changes required in core code, everything could be contained in mod/choosegroup/* directory.

            Petr

            Show
            skodak Petr Skoda added a comment - Thanks for the report and patch, I looked at the code a bit already. I would personally prefer if it was implemented as separate module similar to current choice. The problem is we need much more settings for various different scenarios and there is no place for that in course table and I do not think we should add more stuff into that anyway. Ideally it should be possible to distribute students into groups from selected grouping, which means you need several different groups selections in one course. Current module framework should be suitable for this task and there would be no changes required in core code, everything could be contained in mod/choosegroup/* directory. Petr
            Hide
            ghillenb Gisela Hillenbrand added a comment -

            Hi Petr,

            I agree with you that it is not good to add and add fields in the course table to configure just another course setting. The feature to configure that students can enrol in one or many groups has indeed little priority.

            However that feature as such that they can enrol themselves and not by the teacher is a reasonable one, espescially if they enrol themselves in the course, so why not also into groups. And also the possibility to configure the max. number of group members for a group.

            We discussed with Martin in Heidelberg the alternative "choice". He did not like it so much because it is kind of workaraund - you use an activity for such a thing like group functionality. Instead he was really interested in the code modifications which directly affect the group functionality.

            I know the choice alternative and we use it also at our organization. With a choice students can select their preferred group themselves. But still with standard Moodle the teacher has to create the groups and distribute the students after the choice is completed. For this we added a little modification to the file mod/choice/report.php: Here is the diff:

            253a254,289
            > //GHD: go through all choice options, if there is no group with name = choice option, create the group and put the members into it (i.e. the students which voted for this choice)
            >
            > if ($download == "groups") {
            > $choices = get_records('choice_options','choiceid',$choice->id);
            > $groups = get_groups($course->id);
            > foreach ($choices as $choice) {
            > $flag = 0;
            > foreach ($groups as $group) {
            > if ($group->name == $choice->text)

            { > $flag = 1; > $grouparray[$choice->text] = $group->id; > echo $group->id."\n"; > }

            > }
            > if ($flag == 0)

            { > $grp["name"] = $choice->text; > $grp["lang"] = $course->lang; > $grp["fho_maxallowedgroupmembers"] = $choice->maxanswers; > $groupid=groups_create_group($course->id, $grp); > $grouparray[$choice->text] = $groupid; > }

            > }
            > if ($users) {
            > foreach ($users as $user) {
            > if (!empty($answers[$user->id]))

            { > $userchoice = get_record('choice_options','id',$answers[$u ser->id]->optionid); > groups_add_member($grouparray[$userchoice->text],$user->id ); > }

            > }
            > }
            > // $url = $CFG->wwwroot."/group/index.php?id=".$course->id;
            > redirect($CFG->wwwroot."/group/index.php?id=".$course->id);
            > }
            >
            > // end of modification
            >
            270c306,310
            <

            > echo "</td><td>";
            > $options["download"] = "groups";
            > print_single_button("report.php", $options, get_string("creategroups"));
            > echo "</td><td>";
            > helpbutton("creategroups",get_string('creategroups'));

            Maybe, you can discuss this with Martin? I could also imagine to use a (new) capability like "moodle/course:managemygroupmembership" which allows a user to enrol himself into a group.

            Show
            ghillenb Gisela Hillenbrand added a comment - Hi Petr, I agree with you that it is not good to add and add fields in the course table to configure just another course setting. The feature to configure that students can enrol in one or many groups has indeed little priority. However that feature as such that they can enrol themselves and not by the teacher is a reasonable one, espescially if they enrol themselves in the course, so why not also into groups. And also the possibility to configure the max. number of group members for a group. We discussed with Martin in Heidelberg the alternative "choice". He did not like it so much because it is kind of workaraund - you use an activity for such a thing like group functionality. Instead he was really interested in the code modifications which directly affect the group functionality. I know the choice alternative and we use it also at our organization. With a choice students can select their preferred group themselves. But still with standard Moodle the teacher has to create the groups and distribute the students after the choice is completed. For this we added a little modification to the file mod/choice/report.php: Here is the diff: 253a254,289 > //GHD: go through all choice options, if there is no group with name = choice option, create the group and put the members into it (i.e. the students which voted for this choice) > > if ($download == "groups") { > $choices = get_records('choice_options','choiceid',$choice->id); > $groups = get_groups($course->id); > foreach ($choices as $choice) { > $flag = 0; > foreach ($groups as $group) { > if ($group->name == $choice->text) { > $flag = 1; > $grouparray[$choice->text] = $group->id; > echo $group->id."\n"; > } > } > if ($flag == 0) { > $grp["name"] = $choice->text; > $grp["lang"] = $course->lang; > $grp["fho_maxallowedgroupmembers"] = $choice->maxanswers; > $groupid=groups_create_group($course->id, $grp); > $grouparray[$choice->text] = $groupid; > } > } > if ($users) { > foreach ($users as $user) { > if (!empty($answers [$user->id] )) { > $userchoice = get_record('choice_options','id',$answers[$u ser->id]->optionid); > groups_add_member($grouparray[$userchoice->text],$user->id ); > } > } > } > // $url = $CFG->wwwroot."/group/index.php?id=".$course->id; > redirect($CFG->wwwroot."/group/index.php?id=".$course->id); > } > > // end of modification > 270c306,310 < — > echo "</td><td>"; > $options ["download"] = "groups"; > print_single_button("report.php", $options, get_string("creategroups")); > echo "</td><td>"; > helpbutton("creategroups",get_string('creategroups')); Maybe, you can discuss this with Martin? I could also imagine to use a (new) capability like "moodle/course:managemygroupmembership" which allows a user to enrol himself into a group.
            Hide
            skodak Petr Skoda added a comment -

            I do not agree on this with Martin
            we have a little meeting tomorrow, I hope we can get to some conclusion

            Anyway we all agree we need such feature, the technical stuff and implementation is just a detail.

            Show
            skodak Petr Skoda added a comment - I do not agree on this with Martin we have a little meeting tomorrow, I hope we can get to some conclusion Anyway we all agree we need such feature, the technical stuff and implementation is just a detail.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment - - edited

            I really would split this into two:

            1- The capabilities needed to allow one student to add/delete himself to/from a group (2 capabilities, IMO).
            2- Any other "special" thing, like max number of members... etc.

            1) should/could be implemented as a "pure" roles/capabilities solution and it has been requested a lot of times in forums... or perhaps a custom utility could address it, offering students what groups can be selected and other types of controls.

            2) well that's IMO more difficult to address, because the possibilities are infinite (max number of users in a group, define groups as mandatory disjunct, to force one participant to be added to only one from a given set, date controlling when participants can add themselves....) and we should analyse it completely before starting new developments.

            Just one quick thought, ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - - edited I really would split this into two: 1- The capabilities needed to allow one student to add/delete himself to/from a group (2 capabilities, IMO). 2- Any other "special" thing, like max number of members... etc. 1) should/could be implemented as a "pure" roles/capabilities solution and it has been requested a lot of times in forums... or perhaps a custom utility could address it, offering students what groups can be selected and other types of controls. 2) well that's IMO more difficult to address, because the possibilities are infinite (max number of users in a group, define groups as mandatory disjunct, to force one participant to be added to only one from a given set, date controlling when participants can add themselves....) and we should analyse it completely before starting new developments. Just one quick thought, ciao
            Hide
            krause Ralf Krause added a comment -

            Hi Gisela,

            yes, it would be great to get this new feature in Moodle as soon as possible. I do not think that this feature should get little priority. I our daily work at school we need to split our classes and learning groups into smaller groups .... why can't we do this in Moodle.

            I think it should be very important to have an additional thing like max number of students in a group. If I want to get a classroom work in selforganized groups then the students should enrol into one or many groups theirself. If I want to get small number of students within each group then Moodle must know the max number of students.

            Ralf

            Show
            krause Ralf Krause added a comment - Hi Gisela, yes, it would be great to get this new feature in Moodle as soon as possible. I do not think that this feature should get little priority. I our daily work at school we need to split our classes and learning groups into smaller groups .... why can't we do this in Moodle. I think it should be very important to have an additional thing like max number of students in a group. If I want to get a classroom work in selforganized groups then the students should enrol into one or many groups theirself. If I want to get small number of students within each group then Moodle must know the max number of students. Ralf
            Hide
            dougiamas Martin Dougiamas added a comment -

            Hi! I just found this bug (thanks, Ralf).

            I'm very much against making this a mod activity (my general rule is that if it can't be used every week in a 16 week course then it shouldn't be an activity) and all for making it a core feature that appears part of the groups interface.

            I agree it would be very useful for all kinds of things (seminars, project work) to allow:

            • limiting of group sizes (per grouping or even per group) to max N, and
            • students to choose their own group (or one group per grouping)

            I feel pretty sure an elegant way to do this must be possible.

            I've not looked at these patches yet (thanks, Gisela! Nice to meet you too!) but hopefully can do so soon.

            Show
            dougiamas Martin Dougiamas added a comment - Hi! I just found this bug (thanks, Ralf). I'm very much against making this a mod activity (my general rule is that if it can't be used every week in a 16 week course then it shouldn't be an activity) and all for making it a core feature that appears part of the groups interface. I agree it would be very useful for all kinds of things (seminars, project work) to allow: limiting of group sizes (per grouping or even per group) to max N, and students to choose their own group (or one group per grouping) I feel pretty sure an elegant way to do this must be possible. I've not looked at these patches yet (thanks, Gisela! Nice to meet you too!) but hopefully can do so soon.
            Hide
            skodak Petr Skoda added a comment - - edited

            1/ if it is not a module we need new tables and fields in db which disqualifies it from 1.9.x
            2/ if it is not a module it would be much much harder to tweak and customize because you can not tweak core tables
            3/ it may be definitively used every week, because each week may use different grouping

            Show
            skodak Petr Skoda added a comment - - edited 1/ if it is not a module we need new tables and fields in db which disqualifies it from 1.9.x 2/ if it is not a module it would be much much harder to tweak and customize because you can not tweak core tables 3/ it may be definitively used every week, because each week may use different grouping
            Hide
            dougiamas Martin Dougiamas added a comment -

            At the moment I'm still leaning to core tables and API (to keep all group stuff together, and it's natural to add 1-1 fields to groups table) but there could be a very light activity module (with a setting to choose a grouping) so that a teacher could insert a "group choice" activity in the course. Perhaps we could even expand Choice to have subtypes like Assignment. Hmm ...

            Show
            dougiamas Martin Dougiamas added a comment - At the moment I'm still leaning to core tables and API (to keep all group stuff together, and it's natural to add 1-1 fields to groups table) but there could be a very light activity module (with a setting to choose a grouping) so that a teacher could insert a "group choice" activity in the course. Perhaps we could even expand Choice to have subtypes like Assignment. Hmm ...
            Hide
            ray Ray Lawrence added a comment -

            The last thing we need is a another set of interfaces and rules for groups. Teachers may need to monitor who is in which group and make modifications to membership too. These self elected groups will need to be taken into account with other groups in a course and must have equal opportunity to utilise groupings too. Implementing as a module just throws the entire logic of the current method of doing things. And it needs to be roles based IMO.

            It strikes me that an issue is how students access the interface for managing their own group membership. Why not a groups icon where next to the activity icon where students have the necessary capability(s) and the module has self select groups enabled. When viewing the module an icon (like Logs).

            Hmmm... just thinking there's lots of logic to consider if, say, students can join or leave a group in a forum set up for separate groups... plus lots of other interesting scenarios.

            Show
            ray Ray Lawrence added a comment - The last thing we need is a another set of interfaces and rules for groups. Teachers may need to monitor who is in which group and make modifications to membership too. These self elected groups will need to be taken into account with other groups in a course and must have equal opportunity to utilise groupings too. Implementing as a module just throws the entire logic of the current method of doing things. And it needs to be roles based IMO. It strikes me that an issue is how students access the interface for managing their own group membership. Why not a groups icon where next to the activity icon where students have the necessary capability(s) and the module has self select groups enabled. When viewing the module an icon (like Logs). Hmmm... just thinking there's lots of logic to consider if, say, students can join or leave a group in a forum set up for separate groups... plus lots of other interesting scenarios.
            Hide
            derekcx Derek Chirnside added a comment -

            Martin: you said:

            [ Show » ]
            Martin Dougiamas - 25/Mar/08 12:45 AM At the moment I'm still leaning to core tables and API (to keep all group stuff together, and it's natural to add 1-1 fields to groups table) but there could be a very light activity module (with a setting to choose a grouping) so that a teacher could insert a "group choice" activity in the course. Perhaps we could even expand Choice to have subtypes like Assignment. Hmm ..."

            Are you still leaning this way?

            I'm curious about the odds of this getting into 2.0. (We have a report due soon, and I need to put something in it)

            There is further comment here: http://tracker.moodle.org/browse/MDL-1310

            Show
            derekcx Derek Chirnside added a comment - Martin: you said: [ Show » ] Martin Dougiamas - 25/Mar/08 12:45 AM At the moment I'm still leaning to core tables and API (to keep all group stuff together, and it's natural to add 1-1 fields to groups table) but there could be a very light activity module (with a setting to choose a grouping) so that a teacher could insert a "group choice" activity in the course. Perhaps we could even expand Choice to have subtypes like Assignment. Hmm ..." Are you still leaning this way? I'm curious about the odds of this getting into 2.0. (We have a report due soon, and I need to put something in it) There is further comment here: http://tracker.moodle.org/browse/MDL-1310
            Hide
            ecastro Enrique Castro added a comment -

            Hi all:
            I have just found this issue. I had discussed groups and groupings quite deeply with Petr for inclusion in 1.9.

            I DO have another way to perform tha task: allowing that students can self-assign to an existing (teacher-created) group.
            This is based on old ideas from Gustav Delius (I think). A separate page devoted ONLY to present groups (within Groupings) to students and allow then to self-assign to a group. A maxplaces factor controsl teh number of students on each group. This page is linked from People block, just like "Participants", it s another way to look at participants.

            I DO have implemented this in 1.9.3 and it is now working in production. The solution Does'nt need to modify any core table, neither creates new ones. I use the "config" filed on groupings table to store the settings (applicable in a per-grouping basis, not per group: I am a groupings guy). I will attahch the code, or set a url for demo.

            Show
            ecastro Enrique Castro added a comment - Hi all: I have just found this issue. I had discussed groups and groupings quite deeply with Petr for inclusion in 1.9. I DO have another way to perform tha task: allowing that students can self-assign to an existing (teacher-created) group. This is based on old ideas from Gustav Delius (I think). A separate page devoted ONLY to present groups (within Groupings) to students and allow then to self-assign to a group. A maxplaces factor controsl teh number of students on each group. This page is linked from People block, just like "Participants", it s another way to look at participants. I DO have implemented this in 1.9.3 and it is now working in production. The solution Does'nt need to modify any core table, neither creates new ones. I use the "config" filed on groupings table to store the settings (applicable in a per-grouping basis, not per group: I am a groupings guy). I will attahch the code, or set a url for demo.
            Hide
            derekcx Derek Chirnside added a comment -

            OK, great. A quick reply!!

            We have some development capacity. Just figuring out IF we go to Moodle, what to do about this issue.
            THANKS Enrique.

            Show
            derekcx Derek Chirnside added a comment - OK, great. A quick reply!! We have some development capacity. Just figuring out IF we go to Moodle, what to do about this issue. THANKS Enrique.
            Hide
            dougiamas Martin Dougiamas added a comment -

            Yes I would still really like to see this in 2.0 (and possibly even 1.9). Enrique can you post your patches?

            Show
            dougiamas Martin Dougiamas added a comment - Yes I would still really like to see this in 2.0 (and possibly even 1.9). Enrique can you post your patches?
            Hide
            loomerds Doug Loomer added a comment -

            I'm a bit unclear about the status of the plugin described here. If I add the new files and diffs code to my 1.9.8 install will I be installing this proposed plugin (and will these do the necessary database modifications to get this plugin working)? Or, is the above code more of a "moci-up" of what the plugin might look like? I am REALLY looking for the intended functionality.

            Show
            loomerds Doug Loomer added a comment - I'm a bit unclear about the status of the plugin described here. If I add the new files and diffs code to my 1.9.8 install will I be installing this proposed plugin (and will these do the necessary database modifications to get this plugin working)? Or, is the above code more of a "moci-up" of what the plugin might look like? I am REALLY looking for the intended functionality.
            Hide
            danielneis Daniel Neis added a comment -

            Hello,

            there is a new discussion about it here: https://moodle.org/mod/forum/discuss.php?d=262635
            And there is some plugins that has these features:
            https://moodle.org/plugins/view.php?plugin=mod_groupselect
            https://moodle.org/plugins/view.php?plugin=mod_choicegroup

            Hope to see this integrated into core =)

            Kind regards,
            Daniel

            Show
            danielneis Daniel Neis added a comment - Hello, there is a new discussion about it here: https://moodle.org/mod/forum/discuss.php?d=262635 And there is some plugins that has these features: https://moodle.org/plugins/view.php?plugin=mod_groupselect https://moodle.org/plugins/view.php?plugin=mod_choicegroup Hope to see this integrated into core =) Kind regards, Daniel
            Hide
            monidu Nicolas Dunand added a comment -

            Hello,
            the mod_choicegroup activity module I'm maintaining does all of the above.

            Show
            monidu Nicolas Dunand added a comment - Hello, the mod_choicegroup activity module I'm maintaining does all of the above.

              People

              • Votes:
                36 Vote for this issue
                Watchers:
                35 Start watching this issue

                Dates

                • Created:
                  Updated: