version 1.59, 2001/12/04 14:56:46
|
version 1.64, 2002/01/17 16:51:07
|
Line 39 use Apache::style;
|
Line 39 use Apache::style;
|
# so xmlparse can reenter the inner_xmlparse loop. |
# so xmlparse can reenter the inner_xmlparse loop. |
|
|
@Apache::scripttag::parser_env = (); |
@Apache::scripttag::parser_env = (); |
sub BEGIN { |
BEGIN { |
&Apache::lonxml::register('Apache::scripttag',('script','scriptlib', |
&Apache::lonxml::register('Apache::scripttag', |
'parserlib','import', |
('script','scriptlib','parserlib','import', |
'window','display', |
'window','display','storetc','physnet', |
'storetc','physnet')); |
'standalone')); |
} |
} |
|
|
sub start_script { |
sub start_script { |
Line 59 sub start_script {
|
Line 59 sub start_script {
|
} elsif ( $target eq 'web' || $target eq 'tex' || |
} elsif ( $target eq 'web' || $target eq 'tex' || |
$target eq 'grade' || $target eq 'answer') { |
$target eq 'grade' || $target eq 'answer') { |
&Apache::run::run($bodytext,$safeeval); |
&Apache::run::run($bodytext,$safeeval); |
if (($ENV{'request.state'} eq 'construct') && ($target eq 'answer')) { |
if (($target eq 'answer') && ($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= &Apache::run::dump($target,$safeeval); |
my $listing= &Apache::run::dump($target,$safeeval); |
$listing =~ s/\n/\\n/g; |
$listing =~ s/\n/\\n/g; |
|
$listing =~ s/\"/"/g; |
|
$listing =~ s/\'/’/g; |
|
$listing =~ s/</</g; |
|
$listing =~ s/>/>/g; |
|
$listing =~ s/&/&/g; |
$result.=$listing; |
$result.=$listing; |
$result.= "</pre></body></html>\');newWindow.document.close();void(0);\">Script Vars</a><br />"; |
$result.= "</pre></body></html>\');newWindow.document.close();void(0);\">Script Vars</a><br />"; |
} |
} |
Line 329 sub end_physnet {
|
Line 334 sub end_physnet {
|
return ''; |
return ''; |
} |
} |
|
|
|
sub start_standalone { |
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
|
if ($target eq 'web' && $ENV{'request.course.id'} ) { |
|
my $inside = &Apache::lonxml::get_all_text("/standalone",$$parser[-1]); |
|
} |
|
return ''; |
|
} |
|
|
|
sub end_standalone { |
|
return ''; |
|
} |
|
|
|
|
sub xmlparse { |
sub xmlparse { |
my ($string) = @_; |
my ($string) = @_; |
&Apache::lonxml::debug("Got $string"); |
&Apache::lonxml::debug("Got $string"); |