Project

General

Profile

Bug #1949

Populating groups not working as expected

Added by Marko Kastelic about 9 years ago. Updated over 8 years ago.

Status:
Feature implemented
Priority:
Low
Assignee:
Category:
-
Target version:
Start date:
07/09/2010
Due date:
% Done:

100%

Estimated time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

filling up groups with course students does not work as espected;
with limitation "can be member of one group only" one can expect, that you cannont sign the student to the second group, but you can (within the same group category).

limitation is defined within group category settings .

when filling students manualy, the initial list of candidates for the group members includes all the course students including those who are already member of the other groups (list is not filtered)

autopopulating groups follows the same not working procedure.


Files

group_edit.php (13.4 KB) group_edit.php Marko Kastelic, 21/04/2011 09:48
groupmanager.lib.php (60 KB) groupmanager.lib.php Marko Kastelic, 21/04/2011 09:48

Associated revisions

Revision 312b6697 (diff)
Added by Julio Montoya over 8 years ago

Fixes "Populating groups not working as expected" patch sent by Marko Kastelic see #1949

Revision 78ef2845 (diff)
Added by Julio Montoya over 8 years ago

Applying patch sent by Marko Kastelic see #1949

History

#1

Updated by Yannick Warnier almost 9 years ago

  • Priority changed from Normal to Low
  • Target version set to 1.8.8 stable

OK, but low priority because it doesn't prevent you to use the tool

#2

Updated by Yannick Warnier over 8 years ago

Marko, if you want to provide a patch for that, we could integrate it into 1.8.8

#3

Updated by Marko Kastelic over 8 years ago

following filter prevents from auto-fill groups with teachers enrolled in the course as ordinary course users (if you want a course for the teachers in split them into several groups).

main/inc/lib/groupmanager.lib.php

short:
$user_array_in['status'] : status of the user on the platform
$user_array_in['status_rel'] : staus of the user in the course

original

/**
    * Remove all users that are not students and all users who have tutor status
    * from  the list.
    */
    public static function filter_only_students ($user_array_in) {

        $user_array_out = array ();
        foreach ($user_array_in as $this_user)
        {
            if ($this_user['status'] == STUDENT && $this_user['tutor_id'] == 0)
            {
                $user_array_out[] = $this_user;
            }
        }
        return $user_array_out;
    }

changed
/**
    * Remove all users that are not students and all users who have tutor status
    * from  the list.
    */
    public static function filter_only_students ($user_array_in) {

        $user_array_out = array ();
        foreach ($user_array_in as $this_user)
        {
            if ($this_user['status_rel'] == STUDENT && $this_user['tutor_id'] == 0)
            {
                $user_array_out[] = $this_user;
            }
        }
        return $user_array_out;
    }

#4

Updated by Julio Montoya over 8 years ago

  • Status changed from New to Needs more info
  • % Done changed from 0 to 50
#5

Updated by Marko Kastelic over 8 years ago

Just to clarify:

Tutor: is a course user
can be a group member and a group user of the same group
can be a tutor of any group
can be a tutor of all the groups
cannot be a teacher of the course

changed main/group/group_edit.php
(follow group category membership rules)
main/inc/lib/groupmanager.lib.php
added method : fill_groups_list (replicated the first part of the fill_groups : leaving for the optimization

files are attached

to notice:
limitation "can be member of X group only" is very 'soft': if the user A is member of a X groups and the X is decreased after that, only newly assigned users will follow the new rules; as for user A : any change of group membership will leads to follow the new rules

#6

Updated by Yannick Warnier over 8 years ago

  • Status changed from Needs more info to Assigned
  • Assignee set to Julio Montoya
#7

Updated by Julio Montoya over 8 years ago

  • Status changed from Assigned to Needs more info
  • % Done changed from 50 to 60

patch sent:

http://code.google.com/p/chamilo/source/detail?r=51f614605bae4cabaeb17e78666467b330db8aac&repo=classic

is ok for me that teachers can't be tutors they are already teachers and can modify everything in the course

#8

Updated by Marko Kastelic over 8 years ago

looks good for me, thanks

#9

Updated by Julio Montoya over 8 years ago

  • Status changed from Needs more info to Feature implemented
  • % Done changed from 60 to 100

Also available in: Atom PDF