version 1.100, 2004/04/01 18:49:39
|
version 1.109, 2005/01/14 21:15:09
|
Line 357 sub CreateInterface {
|
Line 357 sub CreateInterface {
|
$Str .= '<input type="submit" name="ClearCache" value="'. |
$Str .= '<input type="submit" name="ClearCache" value="'. |
&mt('Clear Caches').'" />'; |
&mt('Clear Caches').'" />'; |
$Str .= ' 'x5; |
$Str .= ' 'x5; |
|
$Str .= |
|
&mt('Status [_1]', |
|
'<input type="text" name="stats_status" size="60" value="" />'); |
$Str .= '<br />'; |
$Str .= '<br />'; |
return $Str; |
return $Str; |
} |
} |
Line 476 my @OutputDataOptions =
|
Line 479 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 497 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 514 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', |
longdesc =>'The 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', |
{ name =>'Parts Correct', |
base =>'tries', |
base =>'tries', |
Line 524 my @OutputDataOptions =
|
Line 531 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 603 Return a line of the chart for a student
|
Line 611 Return a line of the chart for a student
|
|
|
my $nodata_count; # The number of students for which there is no data |
my $nodata_count; # The number of students for which there is no data |
my %prog_state; # progress state used by loncommon PrgWin routines |
my %prog_state; # progress state used by loncommon PrgWin routines |
|
my $total_sum_width; |
|
|
sub html_initialize { |
sub html_initialize { |
my ($r) = @_; |
my ($r) = @_; |
Line 629 sub html_initialize {
|
Line 638 sub html_initialize {
|
} |
} |
# |
# |
# Compute the column widths and output the sequence titles |
# Compute the column widths and output the sequence titles |
|
my $total_count; |
foreach my $sequence (&Apache::lonstatistics::Sequences_with_Assess()){ |
foreach my $sequence (&Apache::lonstatistics::Sequences_with_Assess()){ |
# |
# |
# Comptue column widths |
# Comptue column widths |
Line 638 sub html_initialize {
|
Line 648 sub html_initialize {
|
# Use 1 digit for a space |
# Use 1 digit for a space |
$sequence->{'width_sum'} += 1; |
$sequence->{'width_sum'} += 1; |
} |
} |
|
$total_count += $sequence->{'num_assess_parts'}; |
# Use 3 digits for the sum |
# Use 3 digits for the sum |
$sequence->{'width_sum'} += 3; |
$sequence->{'width_sum'} += 3; |
} |
} |
Line 668 sub html_initialize {
|
Line 679 sub html_initialize {
|
length($sequence->{'title'}) |
length($sequence->{'title'}) |
).$padding; |
).$padding; |
} |
} |
$Str .= "total</pre>\n"; |
$total_sum_width = length($total_count)+1; |
|
$Str .= " total</pre>\n"; |
$Str .= "<pre>"; |
$Str .= "<pre>"; |
$r->print($Str); |
$r->print($Str); |
$r->rflush(); |
$r->rflush(); |
Line 686 sub html_outputstudent {
|
Line 698 sub html_outputstudent {
|
my @to_show = &get_student_fields_to_show(); |
my @to_show = &get_student_fields_to_show(); |
foreach my $field (@to_show) { |
foreach my $field (@to_show) { |
my $title=$student->{$field}; |
my $title=$student->{$field}; |
|
# Deal with 'comments' - how I love special cases |
|
if ($field eq 'comments') { |
|
$title = '<a href="/adm/'.$student->{'domain'}.'/'.$student->{'username'}.'/'.'aboutme#coursecomment">'.&mt('Comments').'</a>'; |
|
} |
my $base = length($title); |
my $base = length($title); |
my $width=$Apache::lonstatistics::StudentData{$field}->{'width'}; |
my $width=$Apache::lonstatistics::StudentData{$field}->{'width'}; |
$Str .= $title.' 'x($width-$base).$padding; |
$Str .= $title.' 'x($width-$base).$padding; |
Line 763 sub html_outputstudent {
|
Line 779 sub html_outputstudent {
|
$max += $seq_stats->{'max'}; |
$max += $seq_stats->{'max'}; |
} |
} |
if (! defined($score)) { |
if (! defined($score)) { |
$score = ' 'x3; |
$score = ' ' x $total_sum_width; |
|
} else { |
|
$score = sprintf("%.0f",$score); |
} |
} |
$Str .= ' '.' 'x(length($max)-length($score)).$score.'/'.$max; |
$Str .= ' '.' 'x($total_sum_width-length($score)).$score.' / '.$max; |
$Str .= " \n"; |
$Str .= " \n"; |
# |
# |
$r->print($Str); |
$r->print($Str); |
Line 791 sub html_finish {
|
Line 809 sub html_finish {
|
} |
} |
|
|
sub StudentAverageTotal { |
sub StudentAverageTotal { |
my $Str = "<h3>Summary Tables</h3>\n"; |
my $Str = '<h3>'.&mt('Summary Tables').'</h3>'.$/; |
# my $max_students; |
|
# my $total_ave = 0; |
|
# my $total_max = 0; |
|
$Str .= '<table border=2 cellspacing="1">'."\n"; |
$Str .= '<table border=2 cellspacing="1">'."\n"; |
$Str .= "<tr><th>Title</th><th>Average</th><th>Maximum</th></tr>\n"; |
$Str .= '<tr>'. |
|
'<th>'.&mt('Title').'</th>'. |
|
'<th>'.&mt('Average').'</th>'. |
|
'<th>'.&mt('Maximum').'</th>'. |
|
'</tr>'.$/; |
foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) { |
foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) { |
my $ave; |
my $ave; |
my $num_students = $Statistics->{$seq->{'symb'}}->{'num_students'}; |
my $num_students = $Statistics->{$seq->{'symb'}}->{'num_students'}; |
# if ($num_students > $max_students) { |
|
# $max_students = $num_students; |
|
# } |
|
if ($num_students > 0) { |
if ($num_students > 0) { |
$ave = int(100* |
$ave = int(100* |
($Statistics->{$seq->{'symb'}}->{'score'}/$num_students) |
($Statistics->{$seq->{'symb'}}->{'score'}/$num_students) |
Line 810 sub StudentAverageTotal {
|
Line 826 sub StudentAverageTotal {
|
} else { |
} else { |
$ave = 0; |
$ave = 0; |
} |
} |
# $total_ave += $ave; |
|
my $max = $Statistics->{$seq->{'symb'}}->{'max'}; |
my $max = $Statistics->{$seq->{'symb'}}->{'max'}; |
# $total_max += $max; |
|
$ave = sprintf("%.2f",$ave); |
$ave = sprintf("%.2f",$ave); |
$Str .= '<tr><td>'.$seq->{'title'}.'</td>'. |
$Str .= '<tr><td>'.$seq->{'title'}.'</td>'. |
'<td align="right">'.$ave.' </td>'. |
'<td align="right">'.$ave.' </td>'. |
'<td align="right">'.$max.' '.'</td></tr>'."\n"; |
'<td align="right">'.$max.' '.'</td></tr>'."\n"; |
} |
} |
# $total_ave = sprintf('%.2f',$total_ave); # only two digit |
|
$Str .= "</table>\n"; |
$Str .= "</table>\n"; |
# $Str .= '<table border=2 cellspacing="1">'."\n"; |
|
# $Str .= '<tr><th>Number of Students</th><th>Average</th>'. |
|
# "<th>Maximum</th></tr>\n"; |
|
# $Str .= '<tr>'. |
|
# '<td align="right">'.$max_students.'</td>'. |
|
# '<td align="right">'.$total_ave.' '.'</td>'. |
|
# '<td align="right">'.$total_max.' '.'</td>'; |
|
# $Str .= "</table>\n"; |
|
return $Str; |
return $Str; |
} |
} |
|
|
sub SingleStudentTotal { |
sub SingleStudentTotal { |
my $student = &Apache::lonstatistics::current_student(); |
my $student = &Apache::lonstatistics::current_student(); |
my $Str = "<h3>Summary table for ".$student->{'fullname'}." ". |
my $Str = '<h3>'.&mt('Summary table for [_1] ([_2]@[_3])', |
$student->{'username'}.'@'.$student->{'domain'}."</h3>\n"; |
$student->{'fullname'}, |
|
$student->{'username'},$student->{'domain'}).'</h3>'; |
|
$Str .= $/; |
$Str .= '<table border=2 cellspacing="1">'."\n"; |
$Str .= '<table border=2 cellspacing="1">'."\n"; |
$Str .= |
$Str .= |
"<tr><th>Sequence or Folder</th><th>Score</th><th>Maximum</th></tr>\n"; |
'<tr>'. |
|
'<th>'.&mt('Sequence or Folder').'</th>'; |
|
if ($chosen_output->{'base'} eq 'tries') { |
|
$Str .= '<th>'.&mt('Parts Correct').'</th>'; |
|
} else { |
|
$Str .= '<th>'.&mt('Score').'</th>'; |
|
} |
|
$Str .= '<th>'.&mt('Maximum').'</th>'."</tr>\n"; |
my $total = 0; |
my $total = 0; |
my $total_max = 0; |
my $total_max = 0; |
foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) { |
foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) { |
Line 849 sub SingleStudentTotal {
|
Line 863 sub SingleStudentTotal {
|
$total += $value; |
$total += $value; |
$total_max +=$max; |
$total_max +=$max; |
} |
} |
$Str .= '<tr><td><b>Total</b></td>'. |
$Str .= '<tr><td><b>'.&mt('Total').'</b></td>'. |
'<td align="right">'.$total.'</td>'. |
'<td align="right">'.$total.'</td>'. |
'<td align="right">'.$total_max."</td></tr>\n"; |
'<td align="right">'.$total_max."</td></tr>\n"; |
$Str .= "</table>\n"; |
$Str .= "</table>\n"; |
Line 888 my %prog_state; # progress window state
|
Line 902 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 915 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 911 sub excel_initialize {
|
Line 927 sub excel_initialize {
|
# Add 2 because we need a 'sequence_sum' and 'total' column for each |
# Add 2 because we need a 'sequence_sum' and 'total' column for each |
$total_columns += 2; |
$total_columns += 2; |
} |
} |
|
my $too_many_cols_error_message = |
|
'<h2>'.&mt('Unable to Complete Request').'</h2>'.$/. |
|
'<p>'.&mt('LON-CAPA is unable to produce your Excel spreadsheet because your selections will result in more than 255 columns. Excel allows only 255 columns in a spreadsheet.').'</p>'.$/. |
|
'<p>'.&mt('You may consider reducing the number of <b>Sequences or Folders</b> you have selected.').'</p>'.$/. |
|
'<p>'.&mt('LON-CAPA can produce <b>CSV</b> files of this data or Excel files of the <b>Scores Summary</b> data.').'</p>'.$/; |
if ($chosen_output->{'base'} eq 'tries' && $total_columns > 255) { |
if ($chosen_output->{'base'} eq 'tries' && $total_columns > 255) { |
$r->print(<<END); |
$r->print($too_many_cols_error_message); |
<h2>Unable to Complete Request</h2> |
$request_aborted = 1; |
<p> |
|
LON-CAPA is unable to produce your Excel spreadsheet because your selections |
|
will result in more than 255 columns. Excel allows only 255 columns in a |
|
spreadsheet. |
|
</p><p> |
|
You may consider reducing the number of <b>Sequences or Folders</b> you |
|
have selected. |
|
</p><p> |
|
LON-CAPA can produce <b>CSV</b> files of this data or Excel files of the |
|
summary data (<b>Parts Correct</b> or <b>Parts Correct & Totals</b>). |
|
</p> |
|
END |
|
$request_aborted = 1; |
|
} |
} |
if ($chosen_output->{'base'} eq 'scores' && $total_columns > 255) { |
if ($chosen_output->{'base'} eq 'scores' && $total_columns > 255) { |
$r->print(<<END); |
$r->print($too_many_cols_error_message); |
<h2>Unable to Complete Request</h2> |
$request_aborted = 1; |
<p> |
|
LON-CAPA is unable to produce your Excel spreadsheet because your selections |
|
will result in more than 255 columns. Excel allows only 255 columns in a |
|
spreadsheet. |
|
</p><p> |
|
You may consider reducing the number of <b>Sequences or Folders</b> you |
|
have selected. |
|
</p><p> |
|
LON-CAPA can produce <b>CSV</b> files of this data or Excel files of the |
|
<b>Scores Summary</b> data. |
|
</p> |
|
END |
|
$request_aborted = 1; |
|
} |
} |
return if ($request_aborted); |
return if ($request_aborted); |
# |
# |
Line 960 END
|
Line 955 END
|
# Determine rows |
# Determine rows |
my $header_row = $rows_output++; |
my $header_row = $rows_output++; |
my $description_row = $rows_output++; |
my $description_row = $rows_output++; |
|
my $notes_row = $rows_output++; |
$rows_output++; # blank row |
$rows_output++; # blank row |
my $summary_header_row; |
my $summary_header_row; |
if ($chosen_output->{'summary_table'}) { |
if ($chosen_output->{'summary_table'}) { |
Line 1034 END
|
Line 1030 END
|
$cols_output = 0; |
$cols_output = 0; |
$excel_sheet->write($description_row,$cols_output++, |
$excel_sheet->write($description_row,$cols_output++, |
$chosen_output->{'shortdesc'}, |
$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 |
# Output headings for the raw data |
############################################## |
############################################## |
Line 1048 END
|
Line 1050 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 1072 END
|
Line 1075 END
|
$cols_output++, |
$cols_output++, |
$res->{'title'}.' part '.$part, |
$res->{'title'}.' part '.$part, |
$format->{'bold'}); |
$format->{'bold'}); |
|
$count++; |
} |
} |
} else { |
} else { |
$excel_sheet->write($resource_name_row, |
$excel_sheet->write($resource_name_row, |
$cols_output++, |
$cols_output++, |
$res->{'title'},$format->{'bold'}); |
$res->{'title'},$format->{'bold'}); |
|
$count++; |
} |
} |
$count++; |
|
} |
} |
} |
} |
# Determine ending cell |
# Determine ending cell |
Line 1125 END
|
Line 1129 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 1170 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 1227 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, |
|
%maximum_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 1275 END
|
Line 1302 END
|
# Initialize progress window |
# Initialize progress window |
%prog_state=&Apache::lonhtmlcommon::Create_PrgWin |
%prog_state=&Apache::lonhtmlcommon::Create_PrgWin |
($r,'Excel File Compilation Status', |
($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, |
&Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state, |
'Processing first student'); |
'Processing first student'); |
Line 1291 sub excel_outputstudent {
|
Line 1319 sub excel_outputstudent {
|
# Write out student data |
# Write out student data |
my @to_show = &get_student_fields_to_show(); |
my @to_show = &get_student_fields_to_show(); |
foreach my $field (@to_show) { |
foreach my $field (@to_show) { |
$excel_sheet->write($rows_output,$cols_output++,$student->{$field}); |
my $value = $student->{$field}; |
|
if ($field eq 'comments') { |
|
$value = &Apache::lonmsg::retrieve_instructor_comments |
|
($student->{'username'},$student->{'domain'}); |
|
} |
|
$excel_sheet->write($rows_output,$cols_output++,$value); |
} |
} |
# |
# |
# Get student assessment data |
# Get student assessment data |
Line 1306 sub excel_outputstudent {
|
Line 1339 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 |
$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 |
($rows_output,$seq->{'Excel:scorecol'}); |
($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); |
my ($performance,$performance_length,$score,$seq_max,$rawdata); |
if ($chosen_output->{'tries'} || $chosen_output->{'correct'}){ |
if ($chosen_output->{'tries'} || $chosen_output->{'correct'}){ |
Line 1379 sub excel_outputstudent {
|
Line 1417 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, |
|
%maximum_cell_translation); |
|
} |
# |
# |
# Bookkeeping |
# Bookkeeping |
$rows_output++; |
$rows_output++; |
Line 1461 END
|
Line 1504 END
|
my $studentcount = scalar(@Apache::lonstatistics::Students); |
my $studentcount = scalar(@Apache::lonstatistics::Students); |
%prog_state=&Apache::lonhtmlcommon::Create_PrgWin |
%prog_state=&Apache::lonhtmlcommon::Create_PrgWin |
($r,'CSV File Compilation Status', |
($r,'CSV File Compilation Status', |
'CSV File Compilation Progress', $studentcount); |
'CSV File Compilation Progress', $studentcount, |
|
'inline',undef,'Statistics','stats_status'); |
# |
# |
# Open a file |
# Open a file |
$filename = '/prtspool/'. |
$filename = '/prtspool/'. |
Line 1480 END
|
Line 1524 END
|
print $outputfile '"'.&Apache::loncommon::csv_translate($description).'",'. |
print $outputfile '"'.&Apache::loncommon::csv_translate($description).'",'. |
'"'.&Apache::loncommon::csv_translate(scalar(localtime(time))).'"'. |
'"'.&Apache::loncommon::csv_translate(scalar(localtime(time))).'"'. |
"\n"; |
"\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 |
# Print out the headings |
my $sequence_row = ''; |
my $sequence_row = ''; |
Line 1526 END
|
Line 1576 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 1542 sub csv_outputstudent {
|
Line 1596 sub csv_outputstudent {
|
# Output student fields |
# Output student fields |
my @to_show = &get_student_fields_to_show(); |
my @to_show = &get_student_fields_to_show(); |
foreach my $field (@to_show) { |
foreach my $field (@to_show) { |
$Str .= '"'.&Apache::loncommon::csv_translate($student->{$field}).'",'; |
my $value = $student->{$field}; |
|
if ($field eq 'comments') { |
|
$value = &Apache::lonmsg::retrieve_instructor_comments |
|
($student->{'username'},$student->{'domain'}); |
|
} |
|
$Str .= '"'.&Apache::loncommon::csv_translate($value).'",'; |
} |
} |
# |
# |
# Get student assessment data |
# Get student assessment data |
Line 1557 sub csv_outputstudent {
|
Line 1616 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 1650 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; |
Line 1724 sub StudentTriesOnSequence {
|
Line 1788 sub StudentTriesOnSequence {
|
} |
} |
# |
# |
if (! defined($tries)) { |
if (! defined($tries)) { |
$tries = $symbol; |
$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 ' ') || |
if ( ($links eq 'yes' && $symbol ne ' ') || |
($links eq 'all')) { |
($links eq 'all')) { |