claroline/claroline/inc/lib/group.lib.inc.php File Reference

Go to the source code of this file.

Namespaces

namespace  CLGRP

Functions

 empty_group ($groupIdList= 'ALL', $course_id=null)
 delete_groups ($groupIdList= 'ALL')
 deleteAllGroups ()
 fill_in_groups ($nbGroupPerUser, $course_id)
 group_count_students_in_course ($course_id)
 group_count_students_in_groups ($course_id=null)
 group_count_students_in_group ($group_id, $course_id=null)
 group_count_group_of_a_user ($user_id, $course_id=null)
 create_group ($prefixGroupName, $maxMember)
 get_course_tutor_list ($currentCourseId)
 get_group_tool_list ($course_id=NULL, $active=true)
 get_user_group_list ($userId, $course=null)
 get_tutor_group_list ($uid)
 get_group_user_list ($gid, $courseId=NULL)
 get_group_list_user_id_list ($gidList, $courseId=NULL)
 get_current_course_group_properties ()
 is_tool_available_in_current_course_groups ($moduleLabel)

Function Documentation

create_group ( prefixGroupName,
maxMember 
)

Create a new group

Parameters:
string $groupName - name of the group
integer $maxMember - max user allowed for this group
Returns:
integer : id of the new group
Author:
Hugues Peeters <peeters@ipm.ucl.ac.be>

Create a directory allowing group student to upload documents

Definition at line 465 of file group.lib.inc.php.

delete_groups ( groupIdList = 'ALL'  ) 

function delete_groups($groupIdList = 'ALL') deletes groups and their datas.

Parameters:
mixed $groupIdList - group(s) to delete. It can be a single id (int) or a list of id (array). If no id is given all the course group are deleted
Returns:
integer : number of groups deleted.
Exceptions:
claro_failure 

Check the data and notify eventmanager of the deletion

Archive and delete the group files

Definition at line 85 of file group.lib.inc.php.

deleteAllGroups (  ) 

Alias of delete_groups() called without parameters

Definition at line 224 of file group.lib.inc.php.

empty_group ( groupIdList = 'ALL',
course_id = null 
)

Remove all user of a group

Parameters:
mixed $groupIdList indicates wich group(s) will be emptied * integer:group_id | array: array of group_id | string 'ALL' * default : ALL
string $course_id course context where the group(s) can be founded * default : null (get id from init)
Returns:
true
Exceptions:
claro_failure errors

Definition at line 37 of file group.lib.inc.php.

fill_in_groups ( nbGroupPerUser,
course_id 
)

Fill in the groups with still unenrolled students. The algorithm takes care to fill first the freest groups with the less enrolled users

Parameters:
integer $nbGroupPerUser
string $course_id course context where the group(s) can be founded
Author:
Chrisptophe Gesché <moosh@claroline.net>,
Hugues Peeters <hugues.peeters@claroline.net>
Returns:
void

Retrieve the present state of the users repartion in groups

Compute the most approriate group fill in

Definition at line 243 of file group.lib.inc.php.

get_course_tutor_list ( currentCourseId  ) 

Return the list of tutor in the current course.

Parameters:
string $currentCourseId
Returns:
array (userId, name, firstname)

Definition at line 543 of file group.lib.inc.php.

get_current_course_group_properties (  ) 

TODO : merge with claro_main.lib.php::claro_get_main_group_properties TODO : merge both with kernel/course.lib.phpClaro_Course

Definition at line 752 of file group.lib.inc.php.

get_group_list_user_id_list ( gidList,
courseId = NULL 
)

return list of user of the group id list. All group must be in the same course

Parameters:
int $gidList list of groupe identification
Returns:
array of int: list of user

Definition at line 723 of file group.lib.inc.php.

get_group_tool_list ( course_id = NULL,
active = true 
)

This dirty function is a blackbox to provide normalised output of tool list for a group like get_course_tool_list($course_id=NULL) in course_home.

It's dirty because data structure is dirty. Tool_list (with clarolabel and tid come from tool tables and group properties and localinit)

Parameters:
$course_id 
boolean $active, if set to true, only activated tools of the platform must be returned
Author:
Christophe Gesché <moosh@claroline.net>
Returns:
array

Definition at line 571 of file group.lib.inc.php.

get_group_user_list ( gid,
courseId = NULL 
)

return list of user of the group id

Parameters:
int $gid groupe identification
Returns:
array of int: list of user

Definition at line 703 of file group.lib.inc.php.

get_tutor_group_list ( uid  ) 

return list of groups id where a given user (userId) is tutor

Parameters:
integer $uid uid to find groups where he's tutor
Returns:
array of integer : group list

Definition at line 682 of file group.lib.inc.php.

get_user_group_list ( userId,
course = null 
)

Return list of groupe subscribed by a given user in a given/current course

Parameters:
integer $user_id
course_syscode $course

Definition at line 650 of file group.lib.inc.php.

group_count_group_of_a_user ( user_id,
course_id = null 
)

Count groups where a user is ennrolled in a given course

Parameters:
integer $user_id
integer (optional) course_id
Returns:
integer Count of groups where a given user is ennrolled in a given (o current) course
Author:
Christophe Gesché <moosh@claroline.net>

Definition at line 445 of file group.lib.inc.php.

group_count_students_in_course ( course_id  ) 

Count student in course.

Parameters:
string course_id
Returns:
integer user qty in the given course
Exceptions:
claro_failure 
Author:
Christophe Gesché <moosh@claroline.net>

Definition at line 391 of file group.lib.inc.php.

group_count_students_in_group ( group_id,
course_id = null 
)

Count users in a given group.

Parameters:
interger (optional) group_id
interger (optional) course_id
Returns:
interger user quantity
Author:
Christophe Gesché <moosh@claroline.net>
Todo:
TODO : rename this function or change it. count include non student users.

Definition at line 427 of file group.lib.inc.php.

group_count_students_in_groups ( course_id = null  ) 

Count users in all groups.

Parameters:
interger (optional) course_id
Returns:
interger user quantity
Author:
Christophe Gesché <moosh@claroline.net>
Todo:
TODO : rename this function or change it. count include non student users.

Definition at line 410 of file group.lib.inc.php.

is_tool_available_in_current_course_groups ( moduleLabel  ) 

TODO : use is_tool_activated_in_groups() to check if the tool is globaly available

Definition at line 809 of file group.lib.inc.php.

Generated on Tue Jun 8 12:28:37 2010 for Claroline API by  doxygen 1.6.3