version 1.22, 2004/09/23 13:50:45
|
version 1.23, 2004/09/23 14:35:54
|
Line 228 sub prepare_html_output {
|
Line 228 sub prepare_html_output {
|
} |
} |
$prob_span += $part_span; |
$prob_span += $part_span; |
} |
} |
my $title = &get_title($prob->title,$prob->src); |
my $title = $prob->compTitle; |
if ($prob_span > 0) { |
if ($prob_span > 0) { |
$headers{'problem'}.= qq{<th colspan="$prob_span">$title</th>}; |
$headers{'problem'}.= qq{<th colspan="$prob_span">$title</th>}; |
} elsif ($single_response) { |
} elsif ($single_response) { |
Line 390 sub html_essay_results {
|
Line 390 sub html_essay_results {
|
} |
} |
my $Str; |
my $Str; |
if (! $single_response) { |
if (! $single_response) { |
my $id = &get_title($prob->title,$prob->src); |
my $id = $prob->compTitle; |
if (defined($partid) && $partid ne '0') { |
if (defined($partid) && $partid ne '0') { |
$id .= ' '.$partid; |
$id .= ' '.$partid; |
} |
} |
Line 506 sub prepare_excel_output {
|
Line 506 sub prepare_excel_output {
|
$r->print('<h1>'.&mt('Unable to complete request').'</h1>'.$/. |
$r->print('<h1>'.&mt('Unable to complete request').'</h1>'.$/. |
'<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('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('Consider selecting fewer problems to generate reports on, or reducing the number of items per problem. Or use HTML or CSV output.').'</p>'.$/. |
'<p>'.&mt('Consider selecting fewer problems to generate reports on, or reducing the number of items per problem. Or use HTML or CSV output.').'</p>'.$/. |
'<p>'.&mt('The last problem that will fit in the current spreadsheet is [_1].',&get_title($lastprob->title,$lastprob->src)).'</p>'); |
'<p>'.&mt('The last problem that will fit in the current spreadsheet is [_1].',$lastprob->compTitle).'</p>'); |
$r->rflush(); |
$r->rflush(); |
return; |
return; |
} |
} |
Line 565 sub prepare_excel_output {
|
Line 565 sub prepare_excel_output {
|
} |
} |
# Problem headers |
# Problem headers |
foreach my $prob (@$Problems) { |
foreach my $prob (@$Problems) { |
my $title = &get_title($prob->title,$prob->src); |
my $title = $prob->compTitle; |
$worksheet->write($title_row,$cols_output, |
$worksheet->write($title_row,$cols_output, |
$title,$format->{'h3'}); |
$title,$format->{'h3'}); |
foreach my $partid (@{$prob->parts}) { |
foreach my $partid (@{$prob->parts}) { |
Line 698 sub write_excel_row {
|
Line 698 sub write_excel_row {
|
return $col; |
return $col; |
} |
} |
|
|
sub get_title { |
|
my ($title,$src) = @_; |
|
if ($title eq '') { |
|
($title) = ($src =~ m|/([^/]+)$|); |
|
} else { |
|
$title =~ s/\:/:/g; |
|
} |
|
return $title; |
|
} |
|
|
|
sub excel_format_response { |
sub excel_format_response { |
my ($answer,$responsetype) = @_; |
my ($answer,$responsetype) = @_; |
if ($responsetype eq 'radiobutton') { |
if ($responsetype eq 'radiobutton') { |
Line 788 sub prepare_csv_output {
|
Line 778 sub prepare_csv_output {
|
# we put the headers into the %headers hash |
# we put the headers into the %headers hash |
my $prob_start_idx = 0; |
my $prob_start_idx = 0; |
foreach my $prob (@$problems) { |
foreach my $prob (@$problems) { |
$headers{'problem'}->[$prob_start_idx] = |
$headers{'problem'}->[$prob_start_idx] = $prob->compTitle; |
&get_title($prob->title,$prob->src); |
|
my $part_start_idx = $prob_start_idx; |
my $part_start_idx = $prob_start_idx; |
foreach my $partid (@{$prob->parts}) { |
foreach my $partid (@{$prob->parts}) { |
$headers{'part'}->[$part_start_idx] = &mt('Part [_1]',$partid); |
$headers{'part'}->[$part_start_idx] = &mt('Part [_1]',$partid); |