version 1.62, 2006/02/27 00:56:47
|
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 808 sub expandnamed {
|
Line 813 sub expandnamed {
|
$result.=$thissum.'+'; |
$result.=$thissum.'+'; |
} |
} |
$result=~s/\+$//; |
$result=~s/\+$//; |
return $result; |
return '('.$result.')'; |
} else { |
} else { |
return 0; |
return 0; |
} |
} |
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>'; |