--- loncom/interface/lonuserutils.pm 2008/01/20 22:25:05 1.50 +++ loncom/interface/lonuserutils.pm 2008/03/06 21:57:33 1.51 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Utility functions for managing LON-CAPA user accounts # -# $Id: lonuserutils.pm,v 1.50 2008/01/20 22:25:05 raeburn Exp $ +# $Id: lonuserutils.pm,v 1.51 2008/03/06 21:57:33 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -4207,17 +4207,29 @@ sub set_login { } sub course_sections { - my ($sections_count,$role) = @_; + my ($sections_count,$role,$current_sec) = @_; my $output = ''; my @sections = (sort {$a <=> $b} keys %{$sections_count}); my $numsec = scalar(@sections); + my $is_selected = ' selected="selected" '; if ($numsec <= 1) { $output = ''.&mt('Select').''."\n". + ' '."\n"; + if ($current_sec eq 'none') { + $output .= + ' \n"; + } else { + $output .= ' \n"; + } } else { $output .= 'multiple="multiple" size="'.$multiple.'">'."\n"; } foreach my $sec (@sections) { - $output .= '\n"; + if ($current_sec eq $sec) { + $output .= '\n"; + } else { + $output .= '\n"; + } } } $output .= '';