--- loncom/interface/lonpickcourse.pm 2006/05/08 21:40:20 1.43 +++ loncom/interface/lonpickcourse.pm 2006/05/18 01:08:50 1.46 @@ -1,7 +1,7 @@ # The LearningOnline Network # Pick a course # -# $Id: lonpickcourse.pm,v 1.43 2006/05/08 21:40:20 raeburn Exp $ +# $Id: lonpickcourse.pm,v 1.46 2006/05/18 01:08:50 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -34,6 +34,7 @@ use Apache::loncommon; use Apache::loncoursedata; use Apache::lonnet; use Apache::lonlocal; +use Apache::longroup; sub handler { my $r = shift; @@ -101,19 +102,13 @@ sub handler { if ($env{'form.form'} eq 'cu' && $env{'form.pickedcourse'}) { $loaditem{'onload'} ="setSections()"; my ($cdom,$cnum) = split/_/,$env{'form.pickedcourse'}; - my %sections_count = (); - $num_sections = &Apache::loncommon::get_sections($cdom,$cnum,\%sections_count); - my @sections = (); - if ($num_sections > 0) { - @sections = (sort {$a <=> $b} keys(%sections_count)); - $seclist = join('","',@sections); - } - my (%curr_groups,$numgroups); - $numgroups = &Apache::loncommon::coursegroups(\%curr_groups,$cdom, - $cnum); - if ($numgroups > 0) { - $groupslist = join(',',sort(keys(%curr_groups))); - } + + my %sections_count = &Apache::loncommon::get_sections($cdom,$cnum); + my @sections = (sort {$a <=> $b} keys(%sections_count)); + $seclist = join('","',@sections); + + my %curr_groups = &Apache::longroup::coursegroups($cdom,$cnum); + $groupslist = join(',',sort(keys(%curr_groups))); } my $jscript; my $title = 'Selecting a course';