--- loncom/xml/scripttag.pm 2003/02/07 22:03:21 1.85 +++ loncom/xml/scripttag.pm 2003/06/18 21:04:42 1.99 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # '; + } + return ('','no'); +} + +sub end_LONCAPA_INTERNAL_LONHTTPD_PORT { return ('','no'); } @@ -73,13 +95,17 @@ sub start_script { &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.=" function LONCAPA_scriptvars_$Apache::lonxml::curdepth() {newWindow=open('','new_W','width=500,height=200,scrollbars=1');newWindow.document.open('text/html','replace');newWindow.document.writeln('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.= "');newWindow.document.close();}Script Vars"; } } elsif ($target eq "edit" ) { #&Apache::run::run($bodytext,$safeeval); @@ -258,8 +284,16 @@ sub end_window { my $result; if ($target eq 'web') { my $output=&Apache::lonxml::endredirection; - $output =~ s/\"/\"\;/g; - $result = "newwindow $output
"; + 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