version 1.84, 2003/01/13 22:18:34
|
version 1.88, 2003/05/14 13:33:00
|
Line 44 BEGIN {
|
Line 44 BEGIN {
|
('script','scriptlib','parserlib','import', |
('script','scriptlib','parserlib','import', |
'window','display','storetc','physnet', |
'window','display','storetc','physnet', |
'standalone','comment', |
'standalone','comment', |
'LONCAPA_INTERNAL_TURN_STYLE_ON')); |
'LONCAPA_INTERNAL_TURN_STYLE_ON', |
|
'LONCAPA_INTERNAL_LONHTTPD_PORT')); |
} |
} |
|
|
sub start_LONCAPA_INTERNAL_TURN_STYLE_ON { |
sub start_LONCAPA_INTERNAL_TURN_STYLE_ON { |
Line 56 sub end_LONCAPA_INTERNAL_TURN_STYLE_ON {
|
Line 57 sub end_LONCAPA_INTERNAL_TURN_STYLE_ON {
|
return ('','no'); |
return ('','no'); |
} |
} |
|
|
|
sub start_LONCAPA_INTERNAL_LONHTTPD_PORT { |
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
|
if ($target eq 'web') { |
|
my $lonhttpdPort=$Apache::lonnet::perlvar{'lonhttpdPort'}; |
|
if (!defined($lonhttpdPort)) { $lonhttpdPort='8080'; } |
|
return '<script type="text/javascript">var lonhttpdport=\''. |
|
$lonhttpdPort.'\';</script>'; |
|
} |
|
return ('','no'); |
|
} |
|
|
|
sub end_LONCAPA_INTERNAL_LONHTTPD_PORT { |
|
return ('','no'); |
|
} |
|
|
sub start_script { |
sub start_script { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
@Apache::scripttag::parser_env = @_; |
@Apache::scripttag::parser_env = @_; |
Line 73 sub start_script {
|
Line 89 sub start_script {
|
&Apache::lonxml::default_homework_load($safeeval); |
&Apache::lonxml::default_homework_load($safeeval); |
} |
} |
&Apache::run::run($bodytext,$safeeval); |
&Apache::run::run($bodytext,$safeeval); |
if (($target eq 'answer') && ($Apache::lonhomework::viewgrades == 'F')) { |
if (($target eq 'answer') && |
|
($ENV{'form.answer_output_mode'} ne 'tex') && |
|
($Apache::lonhomework::viewgrades == 'F')) { |
$Apache::lonxml::evaluate--; |
$Apache::lonxml::evaluate--; |
$result.="<a href=\"javascript:newWindow=open(\'\',\'new_W\',\'width=500,height=200,scrollbars=1\');newWindow.document.open(\'text/html\',\'replace\');newWindow.document.writeln(\'<html><head><title>newwindow</title></head><body bgcolor="#FFFFFF"><pre>"; |
$result.="<a href=\"javascript:newWindow=open(\'\',\'new_W\',\'width=500,height=200,scrollbars=1\');newWindow.document.open(\'text/html\',\'replace\');newWindow.document.writeln(\'<html><head><title>newwindow</title></head><body bgcolor="#FFFFFF"><pre>"; |
my $listing= &HTML::Entities::encode(&Apache::run::dump($target,$safeeval)); |
my $listing= &HTML::Entities::encode(&Apache::run::dump($target,$safeeval)); |
Line 90 sub start_script {
|
Line 108 sub start_script {
|
} else { |
} else { |
if ($target ne "meta") { |
if ($target ne "meta") { |
$result = $token->[4]; |
$result = $token->[4]; |
my $bodytext=&Apache::lonxml::get_all_text("/script",$$parser[$#$parser]); |
my $bodytext=&Apache::lonxml::get_all_text("/script",$parser); |
$result.=$bodytext; |
$result.=$bodytext; |
} |
} |
} |
} |
Line 292 sub start_import {
|
Line 310 sub start_import {
|
my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval); |
my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval); |
if (!$id) { $id=$Apache::lonxml::curdepth; } |
if (!$id) { $id=$Apache::lonxml::curdepth; } |
push(@Apache::inputtags::import,$id); |
push(@Apache::inputtags::import,$id); |
&Apache::lonxml::newparser($parser,\$file,$dir); |
|
|
&Apache::lonxml::newparser($parser,\$file,$dir); |
|
|
} elsif ($target eq "edit" ) { |
} elsif ($target eq "edit" ) { |
$result.=&Apache::edit::tag_start($target,$token); |
$result.=&Apache::edit::tag_start($target,$token); |
$result.=&Apache::edit::editline($token->[1],$bodytext,'',40); |
$result.=&Apache::edit::editline($token->[1],$bodytext,'',40); |
Line 365 sub start_standalone {
|
Line 385 sub start_standalone {
|
my $result=''; |
my $result=''; |
if ($target eq 'web' ) { |
if ($target eq 'web' ) { |
if ( $ENV{'request.course.id'} ) { |
if ( $ENV{'request.course.id'} ) { |
my $inside = &Apache::lonxml::get_all_text("/standalone",$$parser[-1]); |
my $inside = &Apache::lonxml::get_all_text("/standalone",$parser); |
} else { |
} else { |
$result='<table bgcolor="#E1E1E1" border="2"><tr><td>'; |
$result='<table bgcolor="#E1E1E1" border="2"><tr><td>'; |
} |
} |
Line 390 sub start_comment {
|
Line 410 sub start_comment {
|
my $result=''; |
my $result=''; |
if ($target eq 'edit') { |
if ($target eq 'edit') { |
$result=&Apache::edit::tag_start($target,$token); |
$result=&Apache::edit::tag_start($target,$token); |
my $bodytext=&Apache::lonxml::get_all_text("/comment",$$parser[$#$parser]); |
my $bodytext=&Apache::lonxml::get_all_text("/comment",$parser); |
$result.=&Apache::edit::editfield($token->[1],$bodytext,'',80,4) |
$result.=&Apache::edit::editfield($token->[1],$bodytext,'',80,4) |
} elsif ( $target eq 'modified') { |
} elsif ( $target eq 'modified') { |
$result=$token->[4].&Apache::edit::modifiedfield($token); |
$result=$token->[4].&Apache::edit::modifiedfield($token); |
} elsif ( $target eq 'web' || $target eq 'tex' || $target eq 'grade' || |
} elsif ( $target eq 'web' || $target eq 'tex' || $target eq 'grade' || |
$target eq 'answer' || $target eq 'meta' || $target eq 'analyze') { |
$target eq 'answer' || $target eq 'meta' || $target eq 'analyze') { |
#normally throw away comments |
#normally throw away comments |
my $bodytext=&Apache::lonxml::get_all_text("/comment",$$parser[$#$parser]); |
my $bodytext=&Apache::lonxml::get_all_text("/comment",$parser); |
} |
} |
return $result; |
return $result; |
} |
} |
Line 411 sub end_comment {
|
Line 431 sub end_comment {
|
|
|
sub xmlparse { |
sub xmlparse { |
my ($string) = @_; |
my ($string) = @_; |
&Apache::lonxml::debug("Got $string"); |
# &Apache::lonxml::debug("Got $string"); |
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; |