version 1.54, 2001/10/13 06:00:04
|
version 1.56, 2001/11/05 22:59:33
|
Line 34 sub start_script {
|
Line 34 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 'web')) { |
if (($ENV{'request.state'} eq 'construct') && ($target eq 'answer')) { |
$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; |
$result.=$listing; |
$result.=$listing; |
$result.= "</pre></body></html>\');newWindow.document.close();void(0);\">Script Vars</a>"; |
$result.= "</pre></body></html>\');newWindow.document.close();void(0);\">Script Vars</a><br />"; |
} |
} |
} elsif ($target eq "edit" ) { |
} elsif ($target eq "edit" ) { |
#&Apache::run::run($bodytext,$safeeval); |
#&Apache::run::run($bodytext,$safeeval); |
Line 64 sub end_script {
|
Line 64 sub end_script {
|
return $token->[2]; |
return $token->[2]; |
} elsif ($target eq 'edit' ) { |
} elsif ($target eq 'edit' ) { |
return &Apache::edit::end_table(); |
return &Apache::edit::end_table(); |
} elsif (($ENV{'request.state'} eq 'construct') && ($target eq 'web')) { |
} elsif (($ENV{'request.state'} eq 'construct') && ($target eq 'answer')) { |
$Apache::lonxml::evaluate++; |
$Apache::lonxml::evaluate++; |
} |
} |
return ''; |
return ''; |
Line 81 sub start_display {
|
Line 81 sub start_display {
|
} 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') { |
$result=&Apache::run::run($bodytext,$safeeval); |
$result=&Apache::run::run($bodytext,$safeeval); |
if ($target eq 'grade' ) { |
if ($target eq 'grade' || $target eq 'answer' ) { |
$result=''; # grade should produce no output |
$result=''; # grade should produce no output |
} |
} |
} elsif ($target eq "edit" ) { |
} elsif ($target eq "edit" ) { |
Line 238 sub start_import {
|
Line 238 sub start_import {
|
$dir=~s:/[^/]*$::; |
$dir=~s:/[^/]*$::; |
# &Apache::lonxml::debug("directory $dir $location file $file \n<b>END</b>\n"); |
# &Apache::lonxml::debug("directory $dir $location file $file \n<b>END</b>\n"); |
&Apache::lonxml::newparser($parser,\$file,$dir); |
&Apache::lonxml::newparser($parser,\$file,$dir); |
} |
} elsif ($target eq "edit" ) { |
if ($target eq "edit" ) { |
|
$result.=&Apache::edit::tag_start($target,$token); |
$result.=&Apache::edit::tag_start($target,$token); |
$result.=&Apache::edit::editfield($token->[1],$bodytext,'',40,1); |
$result.=&Apache::edit::editfield($token->[1],$bodytext,'',40,1); |
#FIXME this need to convert $bodytext to be a contruction space reference |
#FIXME this need to convert $bodytext to be a contruction space reference |
#my $location=&Apache::lonnet::filelocation($Apache::lonxml::pwd['-1'],$bodytext); |
#my $location=&Apache::lonnet::filelocation($Apache::lonxml::pwd['-1'],$bodytext); |
#$result.="Click<a href=\"$location\">here</a> to edit<br />" |
#$result.="Click<a href=\"$location\">here</a> to edit<br />" |
} |
} elsif ($target eq 'modified') { |
if ($target eq 'modified') { |
|
$bodytext=$$parser[$#$parser]->get_text("/import"); |
$bodytext=$$parser[$#$parser]->get_text("/import"); |
$result=&Apache::edit::modifiedfield($token); |
$result=&Apache::edit::modifiedfield($token); |
&Apache::lonxml::debug($result); |
&Apache::lonxml::debug($result); |
|
} elsif ($target eq 'meta') { |
|
$result.='<import id="'.$Apache::inputtags::part.'">'; |
|
$result.=$bodytext; |
|
$result.='</import>'; |
} |
} |
return $result; |
return $result; |
} |
} |