Diff for /loncom/interface/loncommon.pm between versions 1.297 and 1.298

version 1.297, 2005/11/21 21:06:59 version 1.298, 2005/11/22 00:01:41
Line 3084  sub get_sections { Line 3084  sub get_sections {
 }  }
   
 ###############################################  ###############################################
                                                                                     
   =pod
                                                                                     
   =item coursegroups
   
   Retrieve information about groups in a course,
   
   Input:
   1. Reference to hash to populate with group information. 
   2. Optional course domain
   3. Optional course number
   4. Optional group name
   
   Course domain and number will be taken from user's
   environment if not supplied. Optional group name will'
   be passed to lonnet::get_coursegroups() as a regexp to
   use in the call to the dump function.
   
   Output
   Returns number of groups in the course (subject to the
   optional group name filter).
   
   Side effects:
   Populates the referenced curr_groups hash, with key,
   value pairs. Keys are group names, corresponding values
   are scalars containing group information in XML. This
   can be sent to &get_group_settings() to be parsed.     
   
   =cut 
   
   ###############################################
   
   sub coursegroups {
       my ($curr_groups,$cdom,$cnum,$group) = @_;
       my $numgroups;
       if (!defined($cdom) || !defined($cnum)) {
           my $cid =  $env{'request.course.id'};
           $cdom = $env{'course.'.$cid.'.domain'};
           $cnum = $env{'course.'.$cid.'.num'};
       }
       %{$curr_groups} = &Apache::lonnet::get_coursegroups($cdom,$cnum,$group);
       my ($tmp) = keys(%{$curr_groups});
       if ($tmp=~/^error:/) {
           unless ($tmp eq 'error: 2 tie(GDBM) Failed while attempting dump') {
               &logthis('Error retrieving groups: '.$tmp.' in '.$cnum.':'.
                                                                      $cdom);
           }
           $numgroups = 0;
       } else {
           $numgroups = keys(%{$curr_groups});
       }
       return $numgroups;
   }
   
   ###############################################
   
 =pod  =pod
   
Line 3093  Uses TokeParser to extract group informa Line 3148  Uses TokeParser to extract group informa
 XML used to describe course groups.  XML used to describe course groups.
   
 Input:  Input:
 Scalar containing XML (as retrieved from &lonnet::get_coursegroups).  Scalar containing XML  - as retrieved from &coursegroups().
   
 Output:  Output:
 Hash containing group information as key=values for (a), and  Hash containing group information as key=values for (a), and

Removed from v.1.297  
changed lines
  Added in v.1.298


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>