version 1.11, 2006/07/28 18:44:27
|
version 1.14, 2006/12/04 14:59:56
|
Line 40 Input:
|
Line 40 Input:
|
1. Optional course domain |
1. Optional course domain |
2. Optional course number |
2. Optional course number |
3. Optional group name |
3. Optional group name |
|
4. Optional namespace |
|
|
Course domain and number will be taken from user's |
Course domain and number will be taken from user's |
environment if not supplied. Optional group name will |
environment if not supplied. Optional group name will |
be passed to lonnet::get_coursegroups() as a regexp to |
be passed to lonnet function as a regexp to |
use in the call to the dump function. |
use in the call to the dump function. Optional namespace |
|
will determine whether information is retrieved about current |
|
groups (default) or deleted groups (namespace = deleted_groups). |
|
|
Output |
Output |
Returns hash of groups in the course (subject to the |
Returns hash of groups in a course (subject to the |
optional group name filter). In the hash, the keys are |
optional group name filter). In the hash, the keys are |
group names, and their corresponding values |
group names, and their corresponding values |
are scalars containing group information in XML. This |
are scalars containing group information in XML. This |
Line 60 None.
|
Line 63 None.
|
############################################### |
############################################### |
|
|
sub coursegroups { |
sub coursegroups { |
my ($cdom,$cnum,$group) = @_; |
my ($cdom,$cnum,$group,$namespace) = @_; |
if (!defined($cdom) || !defined($cnum)) { |
if (!defined($cdom) || !defined($cnum)) { |
my $cid = $env{'request.course.id'}; |
my $cid = $env{'request.course.id'}; |
|
|
Line 69 sub coursegroups {
|
Line 72 sub coursegroups {
|
$cdom = $env{'course.'.$cid.'.domain'}; |
$cdom = $env{'course.'.$cid.'.domain'}; |
$cnum = $env{'course.'.$cid.'.num'}; |
$cnum = $env{'course.'.$cid.'.num'}; |
} |
} |
my %curr_groups = &Apache::lonnet::get_coursegroups($cdom,$cnum,$group); |
if (!defined($namespace)) { |
if (my $tmp = &Apache::lonnet::error(%curr_groups)) { |
$namespace = 'coursegroups'; |
undef(%curr_groups); |
} |
&Apache::lonnet::logthis('Error retrieving groups: '.$tmp.' in '.$cnum.':'.$cdom); |
my %groups = &Apache::lonnet::get_coursegroups($cdom,$cnum,$group, |
|
$namespace); |
|
if (my $tmp = &Apache::lonnet::error(%groups)) { |
|
undef(%groups); |
|
&Apache::lonnet::logthis('Error retrieving groups: '.$tmp.' in '.$cnum.':'.$cdom.' - '.$namespace); |
} |
} |
return %curr_groups; |
if (defined($groups{'group_allfolders'."\0".'locked_folder'})) { |
|
delete($groups{'group_allfolders'."\0".'locked_folder'}); |
|
} |
|
return %groups; |
} |
} |
|
|
############################################### |
############################################### |
Line 232 sub group_changes {
|
Line 242 sub group_changes {
|
my $courseid = $cid; |
my $courseid = $cid; |
$courseid =~ s|^/||; |
$courseid =~ s|^/||; |
$courseid =~ s|/|_|; |
$courseid =~ s|/|_|; |
if ($role =~ /^cr/) { |
|
$role =~ s/\//_/g; |
|
} |
|
my %crshash=&Apache::lonnet::coursedescription($cid); |
my %crshash=&Apache::lonnet::coursedescription($cid); |
$cdom = $crshash{'domain'}; |
$cdom = $crshash{'domain'}; |
$cnum = $crshash{'num'}; |
$cnum = $crshash{'num'}; |