--- loncom/interface/statistics/lonstudentassessment.pm 2004/02/12 14:47:55 1.88 +++ loncom/interface/statistics/lonstudentassessment.pm 2004/02/12 16:29:00 1.89 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentassessment.pm,v 1.88 2004/02/12 14:47:55 matthew Exp $ +# $Id: lonstudentassessment.pm,v 1.89 2004/02/12 16:29:00 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -473,6 +473,7 @@ my @OutputDataOptions = sequence_sum => 1, sequence_max => 1, grand_total => 1, + summary_table => 1, shortdesc => 'Total Score and Maximum Possible for each '. 'Sequence or Folder', longdesc => 'The score of each student as well as the '. @@ -488,6 +489,7 @@ my @OutputDataOptions = sequence_sum => 1, sequence_max => 1, grand_total => 1, + summary_table => 1, shortdesc => 'Score on each Problem Part', longdesc =>'The students score on each problem part, computed as'. 'the part weight * part awarded', @@ -502,6 +504,7 @@ my @OutputDataOptions = sequence_sum => 0, sequence_max => 0, grand_total => 0, + summary_table => 1, shortdesc => 'Number of Tries before success on each Problem Part', longdesc =>'The number of tries before success on each problem part.', }, @@ -515,6 +518,7 @@ my @OutputDataOptions = sequence_sum => 1, sequence_max => 1, grand_total => 1, + summary_table => 1, shortdesc => 'Number of Problem Parts completed successfully.', longdesc => 'The Number of Problem Parts completed successfully and '. 'the maximum possible for each student', @@ -616,12 +620,43 @@ sub html_initialize { my $width=$Apache::lonstatistics::StudentData{$field}->{'width'}; $Str .= $title.' 'x($width-$base).$padding; } - # Now the selected sequences need to be listed + # + # Compute the column widths and output the sequence titles foreach my $sequence (&Apache::lonstatistics::Sequences_with_Assess()){ - my $title = $sequence->{'title'}; - my $base = $sequence->{'base_width'}; - my $width = $sequence->{'width'}; - $Str .= $title.' 'x($width-$base).$padding; + # + # Comptue column widths + $sequence->{'width_sum'} = 0; + if ($chosen_output->{'sequence_sum'}) { + # Use 3 digits for the sum + $sequence->{'width_sum'} = 3; + } + if ($chosen_output->{'sequence_max'}) { + if ($sequence->{'width_sum'}>0) { + # One digit for the '/' + $sequence->{'width_sum'} +=1; + } + # Use 3 digits for the total + $sequence->{'width_sum'}+=3; + } + if ($chosen_output->{'every_problem'}) { + # one problem per digit + $sequence->{'width_problem'} = $sequence->{'num_assess_parts'}; + } else { + $sequence->{'width_problem'} = 0; + } + $sequence->{'width_total'} = $sequence->{'width_problem'} + + $sequence->{'width_sum'}; + if ($sequence->{'width_total'} < length($sequence->{'title'})) { + $sequence->{'width_total'} = length($sequence->{'title'}); + $sequence->{'width_problem'} = + $sequence->{'width_total'} - $sequence->{'width_sum'}; + } + # + # Output the sequence titles + $Str .= + $sequence->{'title'}.' 'x($sequence->{'width_total'}- + length($sequence->{'title'}) + ).$padding; } $Str .= "total\n"; $Str .= "
"; @@ -675,17 +710,22 @@ sub html_outputstudent { &StudentPerformanceOnSequence($student,\%StudentsData, $seq,$show_links); } - my $ratio = sprintf("%3d",$score).'/'.sprintf("%3d",$seq_max); - # + my $ratio=''; if ($chosen_output->{'sequence_sum'}) { - $performance = $ratio; - $performance .= ' 'x($seq->{'width'}-length($ratio)); - } else { - # Pad with extra spaces - $performance .= ' 'x($seq->{'width'}-$performance_length- - length($ratio) - ).$ratio; + $ratio .= sprintf("%3d",$score); + } + if ($chosen_output->{'sequence_max'}) { + if ($chosen_output->{'sequence_sum'}) { + $ratio .= '/'; + } + $ratio .= sprintf("%3d",$seq_max); + } + # + if (! $chosen_output->{'every_problem'}) { + $performance = ''; } + $performance .= ' 'x($seq->{'width_problem'}-$performance_length). + $ratio; # $Str .= $performance.$padding; #