--- loncom/interface/statistics/lonstudentassessment.pm 2005/01/05 20:01:46 1.108 +++ loncom/interface/statistics/lonstudentassessment.pm 2005/01/14 21:15:09 1.109 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentassessment.pm,v 1.108 2005/01/05 20:01:46 matthew Exp $ +# $Id: lonstudentassessment.pm,v 1.109 2005/01/14 21:15:09 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -519,6 +519,7 @@ my @OutputDataOptions = maximum_row => 0, shortdesc => 'Number of Tries before success on each Problem Part', longdesc =>'The number of tries before success on each problem part.', + non_html_notes => 'negative values indicate an incorrect problem', }, { name =>'Parts Correct', base =>'tries', @@ -954,6 +955,7 @@ sub excel_initialize { # Determine rows my $header_row = $rows_output++; my $description_row = $rows_output++; + my $notes_row = $rows_output++; $rows_output++; # blank row my $summary_header_row; if ($chosen_output->{'summary_table'}) { @@ -1028,7 +1030,13 @@ sub excel_initialize { $cols_output = 0; $excel_sheet->write($description_row,$cols_output++, $chosen_output->{'shortdesc'}, - $format->{'h3'}); + $format->{'b'}); + # + $cols_output = 0; + $excel_sheet->write($notes_row,$cols_output++, + $chosen_output->{'non_html_notes'}, + $format->{'i'}); + ############################################## # Output headings for the raw data ############################################## @@ -1516,6 +1524,12 @@ END print $outputfile '"'.&Apache::loncommon::csv_translate($description).'",'. '"'.&Apache::loncommon::csv_translate(scalar(localtime(time))).'"'. "\n"; + foreach my $item ('shortdesc','non_html_notes') { + next if (! exists($chosen_output->{$item})); + print $outputfile + '"'.&Apache::loncommon::csv_translate($chosen_output->{$item}).'"'. + "\n"; + } # # Print out the headings my $sequence_row = ''; @@ -1773,10 +1787,16 @@ sub StudentTriesOnSequence { } } # - if (! defined($tries) || $symbol eq '.') { - $tries = $symbol; + if (! defined($tries)) { + $tries = 0; + } + if ($status =~ /^(incorrect|ungraded)/) { + # Bug 3390: show '-' for tries on incorrect problems + # (csv & excel only) + push(@TriesData,-$tries); + } else { + push (@TriesData,$tries); } - push (@TriesData,$tries); # if ( ($links eq 'yes' && $symbol ne ' ') || ($links eq 'all')) {