--- loncom/interface/loncoursedata.pm 2006/05/05 20:03:54 1.167 +++ loncom/interface/loncoursedata.pm 2006/05/09 14:38:09 1.169 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: loncoursedata.pm,v 1.167 2006/05/05 20:03:54 raeburn Exp $ +# $Id: loncoursedata.pm,v 1.169 2006/05/09 14:38:09 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -965,9 +965,8 @@ sub populate_groupnames_table { my $dbh = &Apache::lonmysql::get_dbh(); my $cdom = $env{'course.'.$courseid.'.domain'}; my $cnum = $env{'course.'.$courseid.'.num'}; - my %curr_groups; - my $numgrps = &Apache::loncommon::coursegroups(\%curr_groups,$cdom,$cnum); - return if (!$numgrps); + my %curr_groups = &Apache::loncommon::coursegroups($cdom,$cnum); + return if (!%curr_groups); my $request = 'INSERT IGNORE INTO '.$groupnames_table. '(groupname) VALUES '; foreach my $groupname (sort(keys(%curr_groups)),'none') { @@ -2599,7 +2598,7 @@ sub count_stats { $limit .= ' AND '.$enrollment_limits; } if ($group_limits) { - $limit .= $group_limits; + $limit .= ' AND '.$group_limits; } $request .= $limit.' GROUP BY a.student_id'; # &Apache::lonnet::logthis('request = '.$/.$request); @@ -2711,7 +2710,7 @@ sub get_response_data { $limit .= ' AND '.$enrollment_requirements; } if (defined($group_limits)) { - $limit .= $group_limits; + $limit .= ' AND '.$group_limits; } $request .= $limit.' ORDER BY b.timestamp'; # &Apache::lonnet::logthis("request =\n".$request); @@ -3152,11 +3151,10 @@ sub get_group_memberships { my (%classgroups,%studentgroups); my $now = time; my $access_end = $env{'course.'.$cid.'.default_enrollment_end_date'}; - my (%curr_groups,%groupmemberhash); - my $numgroups = &Apache::loncommon::coursegroups(\%curr_groups,$cdom, - $cnum); - if ($numgroups) { - %groupmemberhash = &Apache::lonnet::get_group_membership($cdom,$cnum); + my %curr_groups =&Apache::loncommon::coursegroups($cdom,$cnum); + if (%curr_groups) { + my %groupmemberhash = + &Apache::lonnet::get_group_membership($cdom,$cnum); foreach my $student (keys(%{$classlist})) { %{$classgroups{$student}} = (); my $hasgroup = 0;