Bug #7306
La création de groupes dans un cours ne prend pas en compte le nombre de places
Description
Dans chamilo LMS 1.9.8 sur la page de céation de groupe d'un cours : main/group/group_creation.php?cidReq=TEST&id_session=0&gidReq=0&origin=
Lors de la formation du groupe, on peut définir un nombre de places dans le groupe:
Le chiffre indiqué n'est pas pris en compte: c'est toujours "8" qu'on saisisse une valeur ou non: /main/group/group.php?action=show_msg&msg=1+groupe%28s%29+a+%28ont%29+%C3%A9t%C3%A9+ajout%C3%A9%28s%29
Par contre sur l'écran d'édition d'un groupe (/main/group/settings.php?cidReq=TEST&id_session=0&origin=&gidReq=1), on peut changer la valeur et elle est bien enregistrée.
Files
Related issues
History
Updated by Imanol Losada over 6 years ago
- Status changed from New to Assigned
When "group_category" (c_group_category) and "group_info" (c_group_info) tables are created inside "create_course_tables" function in file "main/inc/lib/add_course.lib.inc.php", the column max_student is declared as max_student int unsigned NOT NULL default 8.
When creating a group, there no way to give a value to this column, so it will always be its default value (8).
If you create a group larger than max_student value (8) Chamilo will change it to that value. This can be seen inside "create_group" function in file "main/inc/lib/groupmanager.lib.php".
It could be quite weird but there is nothing wrong with this issue.
Updated by Imanol Losada over 6 years ago
Puzzle solved. A course must have a category assigned to make this functionality work properly. If not, it will reproduce the previously explained behaviour.
Updated by Yannick Warnier over 6 years ago
Imanol Losada wrote:
Puzzle solved. A course must have a category assigned to make this functionality work properly. If not, it will reproduce the previously explained behaviour.
This comment doesn't make much sense... What does a course category have to do with groups?
Updated by Imanol Losada over 6 years ago
Yannick Warnier wrote:
Imanol Losada wrote:
Puzzle solved. A course must have a category assigned to make this functionality work properly. If not, it will reproduce the previously explained behaviour.
This comment doesn't make much sense... What does a course category have to do with groups?
I tried to reproduce it and I couldn't do it. Still cheking why is this happening.
Updated by Imanol Losada over 6 years ago
Imanol Losada wrote:
Yannick Warnier wrote:
Imanol Losada wrote:
Puzzle solved. A course must have a category assigned to make this functionality work properly. If not, it will reproduce the previously explained behaviour.
This comment doesn't make much sense... What does a course category have to do with groups?
I tried to reproduce it and I couldn't do it. Still cheking why is this happening.
Yannick, here's what we have it. After saving changes (it doesn't matter if you don't change anything, just click the save button) in the group settings menu, all group limits are reset to 0 (was this behaviour intended?) so the initial-8-people limit disappears. Suggestions?
Updated by Yannick Warnier over 6 years ago
- Category set to Users/Groups
- % Done changed from 0 to 20
Please add the limit field in the global groups configuration so that you can set it to a default value.
If no value (empty) is set, then the limit should not be changed in any group.
If the value is set to "0", then the limit should be set to 0 in all new groups.
If the value is set to anything else, then the limit should be set to this number in all new groups.
In no situation the configuration on this page should change the existing groups. Only the new ones.
When creating a new group, the default value (coming from the category table) should be "proposed" in the creation form, and should be applied if no change is made to the creation form.
If a change is made to this value ("seats") in the creation form, then this value should be used instead of the value in the category table.
Updated by Imanol Losada over 6 years ago
- Assignee changed from Imanol Losada to Julio Montoya
Julio, when creating course groups with 'group category creation' disabled, the group max limit by default will always be 8. There isn't a 'default group max limit' field in course group settings to modify this default value (8) and Yannick and me think this would be necessary. Would this thought be correct?
Updated by Julio Montoya over 6 years ago
- File Selection_005.png Selection_005.png added
- File Selection_006.png Selection_006.png added
- Assignee changed from Julio Montoya to Yannick Warnier
I reproduced the error.
You need to have the this setting to true:
api_get_setting('allow_group_categories')
When you create a group and put "20" as places, this value will be overwritten with 8. Because it's associated with the "default group" that is correctly set to 8.
This is the part of the code:
if ($places == 0) { //if the amount of users per group is not filled in, use the setting from the category $places = $category['max_student']; } else { if ($places > $category['max_student'] && $category['max_student'] != 0) { $places = $category['max_student']; } }
So the behaviour seems correct for me. A "places" value for a group inside a category can't be bigger than the "places" value in the category. You have to edit the "default group category":
What I could add in the form creation is something like this: "Max 8"
Updated by Yannick Warnier almost 6 years ago
- Target version changed from 1.10.0 to 2.0
Postponing. A really deep issue that requires more fiddling (but half resolved by Julio's comment about group categories)