version 1.17, 2003/07/29 05:22:56
|
version 1.17.2.3, 2003/12/05 22:24:20
|
Line 48 use Apache::Constants qw(:common :http);
|
Line 48 use Apache::Constants qw(:common :http);
|
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::loncommon; |
use Apache::loncommon; |
use Apache::Spreadsheet; |
use Apache::Spreadsheet; |
|
use Apache::loncoursedata(); |
use HTML::Entities(); |
use HTML::Entities(); |
use Spreadsheet::WriteExcel; |
use Spreadsheet::WriteExcel; |
use GDBM_File; |
use GDBM_File; |
Line 125 sub clear_package {
|
Line 126 sub clear_package {
|
|
|
sub initialize { |
sub initialize { |
&clear_package(); |
&clear_package(); |
|
&Apache::loncoursedata::clear_internal_caches(); |
} |
} |
|
|
######################################################## |
######################################################## |
Line 148 sub initialize_package {
|
Line 150 sub initialize_package {
|
} |
} |
&load_cached_export_rows(); |
&load_cached_export_rows(); |
&load_parameter_caches(); |
&load_parameter_caches(); |
|
&Apache::loncoursedata::clear_internal_caches(); |
} |
} |
|
|
######################################################## |
######################################################## |
Line 371 sub parent_link {
|
Line 374 sub parent_link {
|
sub outsheet_html { |
sub outsheet_html { |
my $self = shift; |
my $self = shift; |
my ($r) = @_; |
my ($r) = @_; |
|
#################################### |
|
# Report any calculation errors # |
|
#################################### |
|
$r->print($self->html_report_error()); |
################################### |
################################### |
# Determine table structure |
# Determine table structure |
################################### |
################################### |
Line 594 sub compute {
|
Line 601 sub compute {
|
while (my ($parm,$value) = each(%parameters)) { |
while (my ($parm,$value) = each(%parameters)) { |
last if ($self->blackout()); |
last if ($self->blackout()); |
next if ($parm !~ /^(parameter_.*)_problemstatus$/); |
next if ($parm !~ /^(parameter_.*)_problemstatus$/); |
next if ($parameters{$1.'_answerdate'}<time); |
if ($parameters{$1.'_answerdate'} ne '' && |
|
$parameters{$1.'_answerdate'} < time) { |
|
next; |
|
} |
if (lc($value) eq 'no') { |
if (lc($value) eq 'no') { |
# We must blackout this sheet |
# We must blackout this sheet |
$self->blackout(1); |
$self->blackout(1); |
Line 738 sub export_data {
|
Line 748 sub export_data {
|
! defined($Exportrows{$symb}->{$self->{'filename'}})) { |
! defined($Exportrows{$symb}->{$self->{'filename'}})) { |
$self->compute(); |
$self->compute(); |
} |
} |
my @Data = @{$Exportrows{$symb}->{$self->{'filename'}}}; |
my @Data; |
if ($Data[0] =~ /^(.*)___=___/) { |
if ($self->badcalc()) { |
$self->{'sheetname'} = $1; |
@Data = (); |
$Data[0] =~ s/^(.*)___=___//; |
} else { |
} |
@Data = @{$Exportrows{$symb}->{$self->{'filename'}}}; |
for (my $i=0;$i<$#Data;$i++) { |
if ($Data[0] =~ /^(.*)___=___/) { |
$Data[$i]="'".$Data[$i]."'" if ($Data[$i]=~/\D/ && defined($Data[$i])); |
$self->{'sheetname'} = $1; |
|
$Data[0] =~ s/^(.*)___=___//; |
|
} |
|
for (my $i=0;$i<$#Data;$i++) { |
|
if ($Data[$i]=~/\D/ && defined($Data[$i])) { |
|
$Data[$i]="'".$Data[$i]."'"; |
|
} |
|
} |
} |
} |
return @Data; |
return @Data; |
} |
} |
Line 767 sub save_export_data {
|
Line 784 sub save_export_data {
|
return if ($self->temporary()); |
return if ($self->temporary()); |
my $student = $self->{'name'}.':'.$self->{'domain'}; |
my $student = $self->{'name'}.':'.$self->{'domain'}; |
my $symb = $self->{'symb'}; |
my $symb = $self->{'symb'}; |
|
if ($self->badcalc()){ |
|
# do not save data away when calculations have not been done properly. |
|
delete($Exportrows{$symb}); |
|
return; |
|
} |
if (! exists($Exportrows{$symb}) || |
if (! exists($Exportrows{$symb}) || |
! exists($Exportrows{$symb}->{$self->{'filename'}})) { |
! exists($Exportrows{$symb}->{$self->{'filename'}})) { |
return; |
return; |