--- loncom/interface/statistics/lonstudentassessment.pm 2003/05/29 21:41:10 1.50 +++ loncom/interface/statistics/lonstudentassessment.pm 2003/06/02 18:28:37 1.51 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentassessment.pm,v 1.50 2003/05/29 21:41:10 matthew Exp $ +# $Id: lonstudentassessment.pm,v 1.51 2003/06/02 18:28:37 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -603,7 +603,7 @@ sub html_outputstudent { my $studentstats; my $PerformanceStr = ''; foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) { - my ($performance,$score,$seq_max) = + my ($performance,$performance_length,$score,$seq_max) = &StudentPerformanceOnSequence($student,\%StudentsData, $seq,$show_links); my $ratio = $score.'/'.$seq_max; @@ -616,7 +616,7 @@ sub html_outputstudent { $performance .= ' 'x($seq->{'width'}-length($performance)); } else { # Pad with extra spaces - $performance .= ' 'x($seq->{'width'}-$seq_max- + $performance .= ' 'x($seq->{'width'}-$performance_length- length($ratio) ).$ratio; } @@ -987,7 +987,7 @@ sub excel_outputstudent { # # Write out sequence scores and totals data foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) { - my ($performance,$score,$seq_max) = + my ($performance,$performance_length,$score,$seq_max) = &StudentPerformanceOnSequence($student,\%StudentsData, $seq,'no'); if ($show eq 'totals' || $show eq 'scores') { @@ -1147,7 +1147,7 @@ sub csv_outputstudent { # # Output performance data foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) { - my ($performance,$score,$seq_max) = + my ($performance,$performance_length,$score,$seq_max) = &StudentPerformanceOnSequence($student,\%StudentsData, $seq,'no'); if ($show eq 'scores') { @@ -1219,12 +1219,14 @@ sub StudentPerformanceOnSequence { $links = 'no' if (! defined($links)); my $Str = ''; my ($sum,$max) = (0,0); + my $performance_length = 0; foreach my $resource (@{$seq->{'contents'}}) { next if ($resource->{'type'} ne 'assessment'); my $resource_data = $studentdata->{$resource->{'symb'}}; my $value = ''; foreach my $partnum (@{$resource->{'parts'}}) { $max++; + $performance_length++; my $symbol = ' '; # default to space # if (exists($resource_data->{'resource.'.$partnum.'.solved'})) { @@ -1266,6 +1268,9 @@ sub StudentPerformanceOnSequence { $symbol = ' '; } } +# if ($symbol ne ' ') { +# $attempted_sum++; +# } # if ( ($links eq 'yes' && $symbol ne ' ') || ($links eq 'all')) { @@ -1282,7 +1287,10 @@ sub StudentPerformanceOnSequence { } $Str .= $value; } - return ($Str,$sum,$max); + if ($seq->{'randompick'}) { + $max = $seq->{'randompick'}; + } + return ($Str,$performance_length,$sum,$max); } #######################################################