--- loncom/interface/lonstatistics.pm 2003/02/28 21:19:53 1.62 +++ loncom/interface/lonstatistics.pm 2003/03/07 18:46:38 1.64 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstatistics.pm,v 1.62 2003/02/28 21:19:53 matthew Exp $ +# $Id: lonstatistics.pm,v 1.64 2003/03/07 18:46:38 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -235,8 +235,7 @@ sub PrepareClasslist { @StudentDataOrder = qw/fullname username domain id section status/; foreach my $field (@StudentDataOrder) { $StudentData{$field}->{'title'} = $field; - $StudentData{$field}->{'base_width'} = - scalar (my @Tmp = split(//,$field)); + $StudentData{$field}->{'base_width'} = length($field); $StudentData{$field}->{'width'} = $StudentData{$field}->{'base_width'}; } @@ -251,7 +250,7 @@ sub PrepareClasslist { $studenthash->{$field}=$student_data->[$i]; # Keep track of the width of the fields next if (! exists($StudentData{$field})); - my $length = scalar(my @Tmp1 = split(//,$student_data->[$i])); + my $length = length($student_data->[$i]); if ($StudentData{$field}->{'width'} < $length) { $StudentData{$field}->{'width'} = $length; } @@ -437,6 +436,33 @@ sub SetSelectedMaps { } } + +####################################################### +####################################################### + +=pod + +=item &Sequences_with_Assess() + +Returns an array containing the subset of @Sequences which contain +assessments. + +=cut + +####################################################### +####################################################### +sub Sequences_with_Assess { + my @Sequences_to_Show; + foreach my $map_symb (@SelectedMaps) { + foreach my $sequence (@Sequences) { + next if ($sequence->{'symb'} ne $map_symb && $map_symb ne 'all'); + next if ($sequence->{'num_assess'} < 1); + push (@Sequences_to_Show,$sequence); + } + } + return @Sequences_to_Show; +} + ####################################################### ####################################################### @@ -464,12 +490,12 @@ sub PrepareCourseData { # # Compute column widths foreach my $seq (@Sequences) { - my $name_length = scalar(my @Tmp1 = split(//,$seq->{'title'})); + my $name_length = length($seq->{'title'}); my $num_parts = $seq->{'num_assess_parts'}; # # The number of columns needed for the summation text: # " 1/5" = 1+3 columns, " 10/99" = 1+5 columns - my $sum_length = 1+1+2*(scalar(my @Tmp2 = split(//,$num_parts))); + my $sum_length = 1+1+2*(length($num_parts)); my $num_col = $num_parts+$sum_length; if ($num_col < $name_length) { $num_col = $name_length; @@ -1252,14 +1278,12 @@ sub CreateMainMenu { my $Str = ''; $Str .= ''."\n"; - $Str .= ''."\n"; + $Str .= ''."\n"; $Str .= ''."\n"; $Str .= ''."\n"; $Str .= ''."\n"; $Str .= '
Select a ReportStudent Status