version 1.100, 2004/04/01 18:49:39
|
version 1.101, 2004/05/18 17:43:36
|
Line 476 my @OutputDataOptions =
|
Line 476 my @OutputDataOptions =
|
sequence_sum => 1, |
sequence_sum => 1, |
sequence_max => 1, |
sequence_max => 1, |
grand_total => 1, |
grand_total => 1, |
|
grand_maximum => 1, |
summary_table => 1, |
summary_table => 1, |
maximum_row => 1, |
maximum_row => 1, |
shortdesc => 'Total Score and Maximum Possible for each '. |
shortdesc => 'Total Score and Maximum Possible for each '. |
Line 493 my @OutputDataOptions =
|
Line 494 my @OutputDataOptions =
|
sequence_sum => 1, |
sequence_sum => 1, |
sequence_max => 1, |
sequence_max => 1, |
grand_total => 1, |
grand_total => 1, |
|
grand_maximum => 1, |
summary_table => 1, |
summary_table => 1, |
maximum_row => 1, |
maximum_row => 1, |
shortdesc => 'Score on each Problem Part', |
shortdesc => 'Score on each Problem Part', |
Line 509 my @OutputDataOptions =
|
Line 511 my @OutputDataOptions =
|
sequence_sum => 0, |
sequence_sum => 0, |
sequence_max => 0, |
sequence_max => 0, |
grand_total => 0, |
grand_total => 0, |
|
grand_maximum => 0, |
summary_table => 0, |
summary_table => 0, |
maximum_row => 0, |
maximum_row => 0, |
shortdesc => 'Number of Tries before success on each Problem Part', |
shortdesc => 'Number of Tries before success on each Problem Part', |
Line 524 my @OutputDataOptions =
|
Line 527 my @OutputDataOptions =
|
sequence_sum => 1, |
sequence_sum => 1, |
sequence_max => 1, |
sequence_max => 1, |
grand_total => 1, |
grand_total => 1, |
|
grand_maximum => 1, |
summary_table => 1, |
summary_table => 1, |
maximum_row => 0, |
maximum_row => 0, |
shortdesc => 'Number of Problem Parts completed successfully.', |
shortdesc => 'Number of Problem Parts completed successfully.', |
Line 888 my %prog_state; # progress window state
|
Line 892 my %prog_state; # progress window state
|
my $request_aborted; |
my $request_aborted; |
|
|
my $total_formula; |
my $total_formula; |
|
my $maximum_formula; |
|
|
sub excel_initialize { |
sub excel_initialize { |
my ($r) = @_; |
my ($r) = @_; |
Line 900 sub excel_initialize {
|
Line 905 sub excel_initialize {
|
undef (%prog_state); |
undef (%prog_state); |
undef ($request_aborted); |
undef ($request_aborted); |
undef ($total_formula); |
undef ($total_formula); |
|
undef ($maximum_formula); |
# |
# |
my $total_columns = scalar(&get_student_fields_to_show()); |
my $total_columns = scalar(&get_student_fields_to_show()); |
my $num_students = scalar(@Apache::lonstatistics::Students); |
my $num_students = scalar(@Apache::lonstatistics::Students); |
Line 1048 END
|
Line 1054 END
|
# |
# |
# Add the remaining column headers |
# Add the remaining column headers |
my $total_formula_string = '=0'; |
my $total_formula_string = '=0'; |
|
my $maximum_formula_string = '=0'; |
foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) { |
foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) { |
$excel_sheet->write($sequence_name_row,, |
$excel_sheet->write($sequence_name_row,, |
$cols_output,$seq->{'title'},$format->{'bold'}); |
$cols_output,$seq->{'title'},$format->{'bold'}); |
Line 1125 END
|
Line 1132 END
|
&Spreadsheet::WriteExcel::Utility::xl_rowcol_to_cell |
&Spreadsheet::WriteExcel::Utility::xl_rowcol_to_cell |
($first_data_row,$cols_output-1); |
($first_data_row,$cols_output-1); |
if ($chosen_output->{'sequence_max'}) { |
if ($chosen_output->{'sequence_max'}) { |
$excel_sheet->write($resource_name_row,$cols_output++, |
$excel_sheet->write($resource_name_row,$cols_output, |
'maximum', |
'maximum', |
$format->{'bold'}); |
$format->{'bold'}); |
|
$seq->{'Excel:maxcell'} = |
|
&Spreadsheet::WriteExcel::Utility::xl_rowcol_to_cell |
|
($first_data_row,$cols_output); |
|
$seq->{'Excel:maxcol'}=$cols_output; |
|
$maximum_formula_string.='+'. |
|
&Spreadsheet::WriteExcel::Utility::xl_rowcol_to_cell |
|
($first_data_row,$cols_output); |
|
$cols_output++; |
|
|
} |
} |
} |
} |
if ($chosen_output->{'grand_total'}) { |
if ($chosen_output->{'grand_total'}) { |
$excel_sheet->write($resource_name_row,$cols_output++,'Total', |
$excel_sheet->write($resource_name_row,$cols_output++,'Total', |
$format->{'bold'}); |
$format->{'bold'}); |
} |
} |
|
if ($chosen_output->{'grand_maximum'}) { |
|
$excel_sheet->write($resource_name_row,$cols_output++,'Max. Total', |
|
$format->{'bold'}); |
|
} |
$total_formula = $excel_sheet->store_formula($total_formula_string); |
$total_formula = $excel_sheet->store_formula($total_formula_string); |
|
$maximum_formula = $excel_sheet->store_formula($maximum_formula_string); |
############################################## |
############################################## |
# Output a row for MAX, if appropriate |
# Output a row for MAX, if appropriate |
############################################## |
############################################## |
Line 1152 END
|
Line 1173 END
|
# |
# |
# Add the maximums for each sequence or assessment |
# Add the maximums for each sequence or assessment |
my %total_cell_translation; |
my %total_cell_translation; |
|
my %maximum_cell_translation; |
foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) { |
foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) { |
$cols_output=$seq->{'Excel:startcol'}; |
$cols_output=$seq->{'Excel:startcol'}; |
$total_cell_translation{$seq->{'Excel:scorecell'}} = |
$total_cell_translation{$seq->{'Excel:scorecell'}} = |
&Spreadsheet::WriteExcel::Utility::xl_rowcol_to_cell |
&Spreadsheet::WriteExcel::Utility::xl_rowcol_to_cell |
($maximum_data_row,$seq->{'Excel:scorecol'}); |
($maximum_data_row,$seq->{'Excel:scorecol'}); |
|
$maximum_cell_translation{$seq->{'Excel:maxcell'}} = |
|
&Spreadsheet::WriteExcel::Utility::xl_rowcol_to_cell |
|
($maximum_data_row,$seq->{'Excel:maxcol'}); |
my $weight; |
my $weight; |
my $max = 0; |
my $max = 0; |
foreach my $resource (@{$seq->{'contents'}}) { |
foreach my $resource (@{$seq->{'contents'}}) { |
Line 1205 END
|
Line 1230 END
|
$total_formula,undef, |
$total_formula,undef, |
%total_cell_translation); |
%total_cell_translation); |
} |
} |
|
if ($chosen_output->{'grand_maximum'}) { |
|
$excel_sheet->repeat_formula($maximum_data_row,$cols_output++, |
|
$maximum_formula,undef, |
|
%total_cell_translation); |
|
} |
} # End of MAXIMUM row output if ($chosen_output->{'maximum_row'}) { |
} # End of MAXIMUM row output if ($chosen_output->{'maximum_row'}) { |
$rows_output = $first_data_row; |
$rows_output = $first_data_row; |
############################################## |
############################################## |
Line 1306 sub excel_outputstudent {
|
Line 1336 sub excel_outputstudent {
|
# |
# |
# Write out sequence scores and totals data |
# Write out sequence scores and totals data |
my %total_cell_translation; |
my %total_cell_translation; |
|
my %maximum_cell_translation; |
foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) { |
foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) { |
$cols_output = $seq->{'Excel:startcol'}; |
$cols_output = $seq->{'Excel:startcol'}; |
# Keep track of cells to translate in total cell |
# Keep track of cells to translate in total cell |
Line 1379 sub excel_outputstudent {
|
Line 1410 sub excel_outputstudent {
|
$total_formula,undef, |
$total_formula,undef, |
%total_cell_translation); |
%total_cell_translation); |
} |
} |
|
if ($chosen_output->{'grand_maximum'}) { |
|
$excel_sheet->repeat_formula($rows_output,$cols_output++, |
|
$maximum_formula,undef, |
|
%total_cell_translation); |
|
} |
# |
# |
# Bookkeeping |
# Bookkeeping |
$rows_output++; |
$rows_output++; |
Line 1526 END
|
Line 1562 END
|
$sequence_row.= '"",'; |
$sequence_row.= '"",'; |
$resource_row.= '"Total",'; |
$resource_row.= '"Total",'; |
} |
} |
|
if ($chosen_output->{'grand_maximum'}) { |
|
$sequence_row.= '"",'; |
|
$resource_row.= '"Maximum",'; |
|
} |
chomp($sequence_row); |
chomp($sequence_row); |
chomp($resource_row); |
chomp($resource_row); |
print $outputfile $sequence_row."\n"; |
print $outputfile $sequence_row."\n"; |
Line 1557 sub csv_outputstudent {
|
Line 1597 sub csv_outputstudent {
|
# |
# |
# Output performance data |
# Output performance data |
my $total = 0; |
my $total = 0; |
|
my $maximum = 0; |
foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) { |
foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) { |
my ($performance,$performance_length,$score,$seq_max,$rawdata); |
my ($performance,$performance_length,$score,$seq_max,$rawdata); |
if ($chosen_output->{'tries'}){ |
if ($chosen_output->{'tries'}){ |
Line 1590 sub csv_outputstudent {
|
Line 1631 sub csv_outputstudent {
|
$Str .= '"'.$seq_max.'",'; |
$Str .= '"'.$seq_max.'",'; |
} |
} |
$total+=$score; |
$total+=$score; |
|
$maximum += $seq_max; |
} |
} |
if ($chosen_output->{'grand_total'}) { |
if ($chosen_output->{'grand_total'}) { |
$Str .= '"'.$total.'",'; |
$Str .= '"'.$total.'",'; |
} |
} |
|
if ($chosen_output->{'grand_maximum'}) { |
|
$Str .= '"'.$maximum.'",'; |
|
} |
chop($Str); |
chop($Str); |
$Str .= "\n"; |
$Str .= "\n"; |
print $outputfile $Str; |
print $outputfile $Str; |