--- loncom/xml/scripttag.pm 2002/11/14 16:47:41 1.83 +++ loncom/xml/scripttag.pm 2005/04/07 06:56:27 1.126 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # '; + } + return ('','no'); +} + +sub end_LONCAPA_INTERNAL_LONHTTPD_PORT { return ('','no'); } @@ -63,36 +102,49 @@ sub start_script { my $type= &Apache::lonxml::get_param('type',$parstack,$safeeval); &Apache::lonxml::debug("found type of $type"); if ($type eq "loncapa/perl") { - my $bodytext=&Apache::lonxml::get_all_text("/script",$$parser[$#$parser]); if ( $target eq "modified" ) { - $result=$token->[4].&Apache::edit::modifiedfield(); + $result=$token->[4].&Apache::edit::modifiedfield('/script',$parser); } elsif ( $target eq 'web' || $target eq 'tex' || $target eq 'grade' || $target eq 'answer' || $target eq 'analyze' ) { + my $bodytext=&Apache::lonxml::get_all_text_unbalanced("/script",$parser); if (!$Apache::lonxml::default_homework_loaded) { &Apache::lonxml::default_homework_load($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--; - $result.=" +// Script Vars"; + my $listing=&Apache::run::dump($target,$safeeval); + $listing=~s/\'/\\\'/g; + $listing=~s/\n/\\n/g; + $listing=~s/\r/\\r/g; $result.=$listing; - $result.= "</pre></body></html>\');newWindow.document.close();void(0);\">Script Vars"; + $result.= "
"; + my $listing=&Apache::run::dump($target,$safeeval); + $listing=~s/\'/\\\'/g; + $listing=~s/\n/\\n/g; + $listing=~s/\r/\\r/g; $result.=$listing; - $result.= "</pre></body></html>\');newWindow.document.close();void(0);\">Script Vars