--- loncom/xml/scripttag.pm 2001/10/13 06:00:04 1.54 +++ loncom/xml/scripttag.pm 2001/11/12 20:27:28 1.57 @@ -34,13 +34,13 @@ sub start_script { } elsif ( $target eq 'web' || $target eq 'tex' || $target eq 'grade' || $target eq 'answer') { &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--; $result.="newwindow
";
 	my $listing= &Apache::run::dump($target,$safeeval);
 	$listing =~ s/\n/\\n/g;
 	$result.=$listing;
-	$result.= "
\');newWindow.document.close();void(0);\">Script Vars
"; + $result.= "\');newWindow.document.close();void(0);\">Script Vars
"; } } elsif ($target eq "edit" ) { #&Apache::run::run($bodytext,$safeeval); @@ -64,7 +64,7 @@ sub end_script { return $token->[2]; } elsif ($target eq 'edit' ) { 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++; } return ''; @@ -81,7 +81,7 @@ sub start_display { } elsif ( $target eq 'web' || $target eq 'tex' || $target eq 'grade' || $target eq 'answer') { $result=&Apache::run::run($bodytext,$safeeval); - if ($target eq 'grade' ) { + if ($target eq 'grade' || $target eq 'answer' ) { $result=''; # grade should produce no output } } elsif ($target eq "edit" ) { @@ -237,24 +237,35 @@ sub start_import { my $dir=$location; $dir=~s:/[^/]*$::; # &Apache::lonxml::debug("directory $dir $location file $file \nEND\n"); + my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval); + if (!$id) { $id=$Apache::lonxml::curdepth; } + push(@Apache::inputtags::import,$id); &Apache::lonxml::newparser($parser,\$file,$dir); - } - if ($target eq "edit" ) { + } elsif ($target eq "edit" ) { $result.=&Apache::edit::tag_start($target,$token); $result.=&Apache::edit::editfield($token->[1],$bodytext,'',40,1); #FIXME this need to convert $bodytext to be a contruction space reference #my $location=&Apache::lonnet::filelocation($Apache::lonxml::pwd['-1'],$bodytext); #$result.="Clickhere to edit
" - } - if ($target eq 'modified') { + } elsif ($target eq 'modified') { $bodytext=$$parser[$#$parser]->get_text("/import"); $result=&Apache::edit::modifiedfield($token); &Apache::lonxml::debug($result); + } elsif ($target eq 'meta') { + my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval); + $result.=''; + $result.=$bodytext; + $result.=''; } return $result; } sub end_import { + pop(@Apache::inputtags::import); return ''; }