Group choice

Activities ::: mod_choicegroup
Maintained by Nicolas Dunand
This module allows students to enrol themselves in a group within a course. The teacher can select which groups students can chose from and the maximum number of students allowed in each group.
Latest release:
6636 sites
2k downloads
145 fans
Current versions available: 7

This module allows students to enrol themselves in a group within a course. The teacher can choose from which groups the students can chose, and the maximum number of students allowed in each group.

Depending on the activity settings, the students can view the members of each group before making a choise, and change their selected group until the deadline.

Potential privacy issues

Depending on settings chosen by a teacher, students may see what groups other users have chosen.

Screenshots

Screenshot #0

Contributors

Nicolas Dunand (Lead maintainer)
CSE Université de Lausanne: Supporting institution
Please login to view contributors details and/or to contact them

Comments RSS

Comments

  • Carina Martinez
    Fri, 20 Mar 2015, 9:36 PM
    Hi!
    Has anybody tried this plugin over an installation with Oracle DB?
    Thanks!
  • Nicolas Dunand
    Fri, 20 Mar 2015, 10:50 PM
    Hi Carina,

    I haven't tried, but as this module uses Moodle's API which abstracts DB calls, the underlying DB should be irrelevant. So it should be working fine on top of an Oracle database.
  • Martin Vojtela
    Wed, 12 Aug 2015, 5:14 PM
    Hi Nicolas,
    wonderful work! Any chance the next version will re-direct users back to the course after they have made a selection? The current setup is rather confusing for the users.
    All the best,
    Martin
  • Nicolas Dunand
    Wed, 12 Aug 2015, 7:49 PM
    Hi Martin,
    No, little chance of this ever happening. I can't think of any other Moodle module behaving like that, and I don't want to confuse users with a feature "quitting" after usage. I hope I understood you well, if not feel free to explain further.
  • Martin Vojtela
    Wed, 12 Aug 2015, 8:00 PM
    Hi Nicolas,
    All I was trying to say is that from the most obvious use case - 1. user enters the Group Choice activity, 2. user selects a group 3. user goes back to continue the course and see activities relevant to his group. I feel it is counter intuitive to go back to the screen which prompts me to select a group - I just did that after all...

    In essence I am just reinforcing what Mike Keyes wrote 24 Feb 2014, 9:22 PM - any way to add a link/button to return to the course? users are not sure how to get back.

    Cheers, Martin
  • Nicolas Dunand
    Wed, 12 Aug 2015, 8:05 PM
    Hi Martin,
    Indeed, that would make sense. I have to look into it and check what would be a clearer display of what is happening/has happened to the end user, without confusing long-time users, who are used to the current behaviour of the plugin.
  • Martin Vojtela
    Wed, 12 Aug 2015, 8:10 PM
    That is very true, good point. Perhaps a back button as Mike suggested would be more suitable than my idea. In any way, great work Nicolas.
  • Nicolas Dunand
    Wed, 12 Aug 2015, 8:13 PM
    Thanks. I'll be looking into it in the next couple of weeks, as I'll be releasing an update, officially supporting Moodle 2.9.
  • Michael Milette
    Sat, 21 Nov 2015, 2:12 AM
    Hi Nicolas, I would like to contribute some additional fixes to the plugin.

    1) Is the version on GitHub your most recent?

    2) When are you planning on releasing the next version?

    3) Would you prefer individual fixes or a rollup of multiple fixes?
  • Nicolas Dunand
    Mon, 23 Nov 2015, 5:36 PM
    Hi Michael, thanks for offering.

    1) yes
    2) when I've made sur it works flawlessly on Moodle 3.0
    3) individual fixes please
  • Adam Pawelczak
    Thu, 10 Dec 2015, 6:18 AM
    Hi Nicolas,
    We have experienced a problem when a lot of users (ca 250) tryed to use choicegroup simultaneously. Despite the limit of 15 users per group, up to 21 has successfully chosen the same groups.
    I have prepared a fix for it.
    To implement it, remove the rows 370 to 377 in lib.php and paste the code presented below at the same position.
    We have tested this on ca 450 students waiting "in starting blocks" to choose a thesis supervisor. 350 of them have done it in 5 minutes without any problem

    -------------------
    groups_add_member($selected_option->groupid, $userid);
    $groupmember_added = true;
    if ($choicegroup->limitanswers) {
    $groupmember = $DB->get_record('groups_members', array('groupid' => $selected_option->groupid, 'userid'=>$userid));
    $select_count = 'groupid='.$selected_option->groupid.' and id<='.$groupmember->id;
    $countanswers = $DB->count_records_select('groups_members', $select_count);
    $maxans = $choicegroup->maxanswers[$formanswer];
    if ($countanswers > $maxans) {
    groups_remove_member($selected_option->groupid, $userid);
    $groupmember_added = false;
    }
    }
    if ($groupmember_added) {
    ----------

    Best Regards
    Adam Pawełczak


  • Nicolas Dunand
    Thu, 10 Dec 2015, 10:01 PM
    Thanks Adam,

    I just made the required changes (and a couple others) and released an updated version of this plugin. The updated version now also supports officially Moodle 3.0.
  • Sara Cenni
    Wed, 17 Feb 2016, 6:42 PM
    Hi Nicolas,
    thank you very much for your plugin, it's very useful and we're using it in many courses with Moodle 2.8!
    For example, we are using Group choice in a course to reinforce math knowledge. The enrolled students in this course are currently about 1200, but their number will grow in the near future.

    Recently we noticed that the page of group selection has become slower.
    The debug shows that the page executes 2281 queries with 1157 enrolled users in a course.
    In a course with only 15 enrolled students the number of queries drops to 78.
    With a quick debug I found out that the slow-down seems due to the function “choicegroup_get_response_data” . Its “Big function, approx 6 SQL calls per user” comment helped me.

    The following function "choicegroup_get_user_answer" is called for each enrolled student to get the user response:
    foreach ($allresponses[0] as $user) {
    $currentanswers = choicegroup_get_user_answer($choicegroup, $user, true);

    I tried to write this piece of code, replacing part of code inside choicegroup_get_response_data and mixing some of the functions you're using in group choice, to retrieve the responses:
    if (is_numeric($choicegroup)) {
    $choicegroupid = $choicegroup;
    }
    else {
    $choicegroupid = $choicegroup->id;
    }
    $params1 = array('choicegroupid'=>$choicegroupid);
    list($esql, $params2) = get_enrolled_sql($ctx, 'mod/choicegroup:choose', 0);
    $params = array_merge($params1, $params2);
    $sql = 'SELECT gm.*
    FROM {user} u
    JOIN ('.$esql.') je ON je.id = u.id
    JOIN {groups_members} gm
    ON gm.userid = u.id AND groupid IN (
    SELECT groupid FROM {choicegroup_options} WHERE choicegroupid=:choicegroupid)
    WHERE u.deleted = 0 ORDER BY u.lastname ASC,u.firstname ASC';
    $usergroupmemberships = $DB->get_records_sql($sql, $params);

    In this way I think it would be faster.
    Changing this piece of code will obviously mean to change the part of the plugin that shows answers, but do you think that this change could work?

    Thanks in advance,
    Sara
  • Nicolas Dunand
    Wed, 17 Feb 2016, 9:03 PM
    Hi Sara,

    Thanks for your feedback and for offering a solution. I think your idea should work, but I'd need to run some more tests to see whether this would really address the problem.

    I just ran a quick test on a (not very powerful) development server, in a course with 2 groups and about 2000 students, without experiencing real performance problems. For further investigation on this topic, I opened a new issue on the bug tracker for this module ( https://github.com/ndunand/moodle-mod_choicegroup/issues/89 ). Feel free to add to it!

    Btw, I used Moodle's profiling system, which is great at tracking performance issues.
  • Sara Cenni
    Wed, 17 Feb 2016, 9:34 PM
    Hi Nicolas,
    thank you for your quick replay!!! I saw in the issue that you made a test for report.php file. Sorry, I wasn't clear. My test was about view.php. Report.php works well and it doesn't seem to have slowness problem.
    I don't know if it can be useful, but I'm using Oracle. Thank you also for the suggestion of the profiling system. Could you please link me a guide on how to use it?
    Thanks again for your feeback!
    Sara
Please login to post comments