version 1.64, 2006/03/05 21:35:10
|
version 1.66, 2006/04/06 16:43:49
|
Line 85 sub new {
|
Line 85 sub new {
|
my $class = ref($this) || $this; |
my $class = ref($this) || $this; |
my ($stype) = ($class =~ /Apache::(.*)$/); |
my ($stype) = ($class =~ /Apache::(.*)$/); |
# |
# |
my ($name,$domain,$filename,$usymb)=@_; |
my ($name,$domain,$filename,$usymb,$section)=@_; |
if (defined($usymb) && ref($usymb)) { |
if (defined($usymb) && ref($usymb)) { |
$usymb = $usymb->symb; |
$usymb = $usymb->symb; |
} |
} |
Line 95 sub new {
|
Line 95 sub new {
|
if (! defined($domain) || $domain eq '') { |
if (! defined($domain) || $domain eq '') { |
$domain = $env{'user.domain'}; |
$domain = $env{'user.domain'}; |
} |
} |
|
if (! defined($section) || $section eq '') { |
|
$section = &Apache::lonnet::getsection($domain,$name, |
|
$env{'request.course.id'}); |
|
} |
# |
# |
my $self = { |
my $self = { |
name => $name, |
name => $name, |
domain => $domain, |
domain => $domain, |
|
section => $section, |
type => $stype, |
type => $stype, |
symb => $usymb, |
symb => $usymb, |
errorlog => '', |
errorlog => '', |
Line 722 sub calc {
|
Line 727 sub calc {
|
$notfinished=0; |
$notfinished=0; |
while (my ($cell,$value) = each(%t)) { |
while (my ($cell,$value) = each(%t)) { |
my $old=$sheet_values{$cell}; |
my $old=$sheet_values{$cell}; |
#$sheet_values{$cell}=eval $value; |
$sheet_values{$cell}=eval $value; |
# $errorlog .= $cell.' = '.$old.'->'.$sheet_values{$cell}."\n"; |
# $errorlog .= $cell.' = '.$old.'->'.$sheet_values{$cell}."\n"; |
if ($@) { |
if ($@) { |
undef %sheet_values; |
undef %sheet_values; |
Line 1290 sub html_editable_cell {
|
Line 1295 sub html_editable_cell {
|
} |
} |
$name = '' if (! defined($name)); |
$name = '' if (! defined($name)); |
$formula = '' if (! defined($formula)); |
$formula = '' if (! defined($formula)); |
if ($showsource) |
if ($showsource) { |
{ |
|
if (!defined($formula) || $formula =~ /^\s*$/) { |
if (!defined($formula) || $formula =~ /^\s*$/) { |
$value = '<font color="'.$bgcolor.'">#</font>'; |
$value = '<font color="'.$bgcolor.'">#</font>'; |
} else { |
} else { |
$value = &HTML::Entities::encode($formula, '<>&"'); |
$value = &HTML::Entities::encode($formula, '<>&"'); |
} |
} |
} |
} elsif (! defined($value)) { |
elsif (! defined($value)) { |
|
$value = '<font color="'.$bgcolor.'">#</font>'; |
$value = '<font color="'.$bgcolor.'">#</font>'; |
if ($formula ne '') { |
if ($formula ne '') { |
$value = '<i>undefined value</i>'; |
$value = '<i>undefined value</i>'; |