--- loncom/interface/statistics/lonstudentassessment.pm 2004/12/07 15:48:29 1.106
+++ loncom/interface/statistics/lonstudentassessment.pm 2005/01/21 18:52:40 1.110
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonstudentassessment.pm,v 1.106 2004/12/07 15:48:29 matthew Exp $
+# $Id: lonstudentassessment.pm,v 1.110 2005/01/21 18:52:40 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -357,6 +357,9 @@ sub CreateInterface {
$Str .= '';
$Str .= ' 'x5;
+ $Str .=
+ &mt('Status[_1]',
+ '');
$Str .= '
';
return $Str;
}
@@ -516,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',
@@ -951,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'}) {
@@ -1025,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
##############################################
@@ -1193,16 +1204,15 @@ sub excel_initialize {
#
if ($chosen_output->{'sequence_sum'} &&
$chosen_output->{'every_problem'}) {
- my %replaceCells;
- $replaceCells{$seq->{'Excel:startcell'}} =
- &Spreadsheet::WriteExcel::Utility::xl_rowcol_to_cell
- ($maximum_data_row,$seq->{'Excel:startcol'});
- $replaceCells{$seq->{'Excel:endcell'}} =
- &Spreadsheet::WriteExcel::Utility::xl_rowcol_to_cell
- ($maximum_data_row,$seq->{'Excel:endcol'});
+ my %replaceCells=
+ ('^'.$seq->{'Excel:startcell'}.':'.
+ $seq->{'Excel:endcell'}.'$' =>
+ &Spreadsheet::WriteExcel::Utility::xl_rowcol_to_cell($maximum_data_row,$seq->{'Excel:startcol'}).':'.
+ &Spreadsheet::WriteExcel::Utility::xl_rowcol_to_cell($maximum_data_row,$seq->{'Excel:endcol'}));
$excel_sheet->repeat_formula($maximum_data_row,$cols_output++,
$seq->{'Excel:sum'},undef,
- %replaceCells);
+ %replaceCells);
+
} elsif ($chosen_output->{'sequence_sum'}) {
$excel_sheet->write($maximum_data_row,$cols_output++,$max);
}
@@ -1219,7 +1229,7 @@ sub excel_initialize {
if ($chosen_output->{'grand_maximum'}) {
$excel_sheet->repeat_formula($maximum_data_row,$cols_output++,
$maximum_formula,undef,
- %total_cell_translation);
+ %maximum_cell_translation);
}
} # End of MAXIMUM row output if ($chosen_output->{'maximum_row'}) {
$rows_output = $first_data_row;
@@ -1291,7 +1301,8 @@ sub excel_initialize {
# Initialize progress window
%prog_state=&Apache::lonhtmlcommon::Create_PrgWin
($r,'Excel File Compilation Status',
- 'Excel File Compilation Progress', $studentcount);
+ 'Excel File Compilation Progress', $studentcount,
+ 'inline',undef,'Statistics','stats_status');
#
&Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,
'Processing first student');
@@ -1334,6 +1345,10 @@ sub excel_outputstudent {
$total_cell_translation{$seq->{'Excel:scorecell'}} =
&Spreadsheet::WriteExcel::Utility::xl_rowcol_to_cell
($rows_output,$seq->{'Excel:scorecol'});
+ # and maximum cell
+ $maximum_cell_translation{$seq->{'Excel:maxcell'}} =
+ &Spreadsheet::WriteExcel::Utility::xl_rowcol_to_cell
+ ($rows_output,$seq->{'Excel:maxcol'});
#
my ($performance,$performance_length,$score,$seq_max,$rawdata);
if ($chosen_output->{'tries'} || $chosen_output->{'correct'}){
@@ -1367,23 +1382,16 @@ sub excel_outputstudent {
if ($chosen_output->{'sequence_sum'} &&
$chosen_output->{'every_problem'}) {
# Write a formula for the sum of this sequence
- my %replaceCells;
- $replaceCells{$seq->{'Excel:startcell'}} =
- &Spreadsheet::WriteExcel::Utility::xl_rowcol_to_cell
- ($rows_output,$seq->{'Excel:startcol'});
- $replaceCells{$seq->{'Excel:endcell'}} =
- &Spreadsheet::WriteExcel::Utility::xl_rowcol_to_cell
- ($rows_output,$seq->{'Excel:endcol'});
- # The undef is for the format
- if (scalar(keys(%replaceCells)) == 1) {
- $excel_sheet->repeat_formula($rows_output,$cols_output++,
- $seq->{'Excel:sum'},undef,
- %replaceCells,%replaceCells);
- } else {
- $excel_sheet->repeat_formula($rows_output,$cols_output++,
- $seq->{'Excel:sum'},undef,
- %replaceCells);
- }
+ my %replaceCells=
+ ('^'.$seq->{'Excel:startcell'}.':'.$seq->{'Excel:endcell'}.'$'
+ =>
+ &Spreadsheet::WriteExcel::Utility::xl_rowcol_to_cell($rows_output,$seq->{'Excel:startcol'}).':'.
+ &Spreadsheet::WriteExcel::Utility::xl_rowcol_to_cell($rows_output,$seq->{'Excel:endcol'})
+ );
+ # The undef is for the format
+ $excel_sheet->repeat_formula($rows_output,$cols_output++,
+ $seq->{'Excel:sum'},undef,
+ %replaceCells);
} elsif ($chosen_output->{'sequence_sum'}) {
if ($score eq ' ') {
$cols_output++;
@@ -1404,7 +1412,7 @@ sub excel_outputstudent {
if ($chosen_output->{'grand_maximum'}) {
$excel_sheet->repeat_formula($rows_output,$cols_output++,
$maximum_formula,undef,
- %total_cell_translation);
+ %maximum_cell_translation);
}
#
# Bookkeeping
@@ -1488,7 +1496,8 @@ END
my $studentcount = scalar(@Apache::lonstatistics::Students);
%prog_state=&Apache::lonhtmlcommon::Create_PrgWin
($r,'CSV File Compilation Status',
- 'CSV File Compilation Progress', $studentcount);
+ 'CSV File Compilation Progress', $studentcount,
+ 'inline',undef,'Statistics','stats_status');
#
# Open a file
$filename = '/prtspool/'.
@@ -1507,6 +1516,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 = '';
@@ -1764,10 +1779,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')) {