version 1.112, 2004/04/15 20:24:34
|
version 1.115, 2004/08/18 20:48:45
|
Line 138 sub start_script {
|
Line 138 sub start_script {
|
} |
} |
} else { |
} else { |
my $bodytext=&Apache::lonxml::get_all_text_unbalanced("/script",$parser); |
my $bodytext=&Apache::lonxml::get_all_text_unbalanced("/script",$parser); |
if ($target ne "meta") { |
if ($target ne "meta" && $target ne 'tex') { |
$result = $token->[4]; |
$result = $token->[4]; |
$result.=$bodytext; |
$result.=$bodytext; |
} |
} |
Line 152 sub end_script {
|
Line 152 sub end_script {
|
my $type = &Apache::lonxml::get_param('type',$parstack,$safeeval); |
my $type = &Apache::lonxml::get_param('type',$parstack,$safeeval); |
my $result=''; |
my $result=''; |
#other script blocks need to survive |
#other script blocks need to survive |
if ($type ne "loncapa/perl") { |
if ($type ne "loncapa/perl" && $target ne 'tex') { |
return $token->[2]; |
return $token->[2]; |
} elsif ($target eq 'edit' ) { |
} elsif ($target eq 'edit' ) { |
return &Apache::edit::end_table(); |
return &Apache::edit::end_table(); |
Line 179 sub start_display {
|
Line 179 sub start_display {
|
$result=&Apache::run::run($bodytext,$safeeval); |
$result=&Apache::run::run($bodytext,$safeeval); |
if ($target eq 'grade' || $target eq 'answer' || |
if ($target eq 'grade' || $target eq 'answer' || |
$target eq 'analyze') { |
$target eq 'analyze') { |
$result=''; # grade should produce no output |
# grade/answer/analyxe should produce no output but if we |
|
# are redirecting, the redirecter should know what to do |
|
# with the output |
|
if (!$Apache::lonxml::redirection) { $result=''; } |
} |
} |
$Apache::lonxml::post_evaluate=0; |
$Apache::lonxml::post_evaluate=0; |
} elsif ($target eq "edit" ) { |
} elsif ($target eq "edit" ) { |
Line 483 sub end_comment {
|
Line 486 sub end_comment {
|
sub xmlparse { |
sub xmlparse { |
my ($string) = @_; |
my ($string) = @_; |
&Apache::lonxml::debug("xmlparse recursion starting with $string"); |
&Apache::lonxml::debug("xmlparse recursion starting with $string"); |
|
# Apache::run::evaluate does an 'eval' on the name of the subroutine |
|
# if it detects something that looks like a subroutine, this ends up calling |
|
# things without any arguments and since perl is nice enough to pass |
|
# along the default arguments when you don't explicitly say no arguments |
|
# if you call &xmlparse, it gets &xmlparse passed as it argument. |
|
# Same thing soccurs with &chemparse. |
if ($string eq '&xmlparse') { return '&xmlparse'; } |
if ($string eq '&xmlparse') { return '&xmlparse'; } |
|
if ($string eq '&chemparse') { return '&chemparse'; } |
my ($target,$token,$tagstack,$parstack,$oldparser,$safeeval,$style)= |
my ($target,$token,$tagstack,$parstack,$oldparser,$safeeval,$style)= |
@Apache::scripttag::parser_env; |
@Apache::scripttag::parser_env; |
my @parser; |
my @parser; |