--- loncom/interface/lonselstudent.pm 2006/05/17 15:01:40 1.3 +++ loncom/interface/lonselstudent.pm 2006/05/17 15:04:42 1.4 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # lonselstudent.pm : Reusable subs for student selection. # -# $Id: lonselstudent.pm,v 1.3 2006/05/17 15:01:40 albertel Exp $ +# $Id: lonselstudent.pm,v 1.4 2006/05/17 15:04:42 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -71,19 +71,19 @@ sub get_people_in_class { # Enumerate the course_personnel. # my @course_personnel; - for (sort keys %coursepersonnel) { - for my $role (split /,/, $coursepersonnel{$_}) { + for (sort(keys(%coursepersonnel))) { + for my $role (split(/,/, $coursepersonnel{$_})) { # extract the names so we can sort them my @people; - for (split /,/, $role) { - push @people, [split /:/, $role]; + for (split(/,/, $role)) { + push(@people, [split(/:/, $role)]); } - @people = sort { $a->[0] cmp $b->[0] } @people; + @people = sort { $a->[0] cmp $b->[0] } (@people); for my $person (@people) { - push @course_personnel, [join(':', @$person), $person->[0], '', $_]; + push(@course_personnel, [join(':', @$person), $person->[0], '', $_]); } } } @@ -102,14 +102,14 @@ sub get_people_in_class { my $classlist = &Apache::loncoursedata::get_classlist(); - my @keys = keys %{$classlist}; + my @keys = keys(%{$classlist}); # Sort by: Section, name @keys = sort { if ($classlist->{$a}->[$section] ne $classlist->{$b}->[$section]) { return $classlist->{$a}->[$section] cmp $classlist->{$b}->[$section]; } return $classlist->{$a}->[$fullname] cmp $classlist->{$b}->[$fullname]; - } @keys; + } (@keys); @@ -118,9 +118,9 @@ sub get_people_in_class { if ( $classlist->{$_}->[$status] eq 'Active') { - push @current_members, [$_, $classlist->{$_}->[$fullname], + push(@current_members, [$_, $classlist->{$_}->[$fullname], $classlist->{$_}->[$section], - $classlist->{$_}->[$status], 'Student']; + $classlist->{$_}->[$status], 'Student']); } else { # Need to figure out if this user is future or # Expired... If the start date is in the future @@ -128,13 +128,13 @@ sub get_people_in_class { my $now = time; if ($classlist->{$_}->[$start_date] > $now) { - push @future_members, [$_, $classlist->{$_}->[$fullname], + push(@future_members, [$_, $classlist->{$_}->[$fullname], $classlist->{$_}->[$section], - "Future", "Student"]; + "Future", "Student"]); } else { - push @expired_members, [$_, $classlist->{$_}->[$fullname], + push(@expired_members, [$_, $classlist->{$_}->[$fullname], $classlist->{$_}->[$section], - "Expired", "Student"]; + "Expired", "Student"]); } } @@ -355,7 +355,7 @@ SCRIPT # Figure out which students are checked by default... - if(%$defaultusers) { + if (%$defaultusers) { if (exists ($defaultusers->{$user})) { $result .= ' checked ="checked" '; $checked = 1; @@ -364,22 +364,22 @@ SCRIPT $result .= ' checked="checked" '; $checked = 1; # First one for radio if no default specified. } - $result .= ' value="'. HTML::Entities::encode($user . ':' - .$student->[2] . ':' + $result .= ' value="'.&HTML::Entities::encode($user . ':' + .$student->[2] . ':' .$student->[1] . ':' .$student->[3] . ':' .$student->[4] . ":" .$formprefix, "<>&\"'") ."\" />