--- loncom/xml/lonxml.pm 2004/04/15 20:18:46 1.317 +++ loncom/xml/lonxml.pm 2004/06/04 22:56:46 1.322 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.317 2004/04/15 20:18:46 albertel Exp $ +# $Id: lonxml.pm,v 1.322 2004/06/04 22:56:46 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -40,7 +40,7 @@ package Apache::lonxml; use vars -qw(@pwd @outputstack $redirection $import @extlinks $metamode $evaluate %insertlist @namespace $errorcount $warningcount); +qw(@pwd @outputstack $redirection $import @extlinks $metamode $evaluate %insertlist @namespace $errorcount $warningcount @htmlareafields); use strict; use HTML::LCParser(); use HTML::TreeBuilder(); @@ -524,6 +524,10 @@ sub inner_xmlparse { return $finaloutput; } +## +## Looks to see if there is a subroutine defined for this tag. If so, call it, +## otherwise do not call it as we do not know what it is. +## sub callsub { my ($sub,$target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; my $currentstring=''; @@ -556,6 +560,10 @@ sub callsub { $parstack,$parser,$safeeval, $style); } else { + if ($target eq 'tex') { + # throw away tag name + return ''; + } #&Apache::lonxml::debug("NOT Calling sub $sub in $space $metamode"); if ($metamode <1) { if (defined($token->[4]) && ($metamode < 1)) { @@ -728,6 +736,7 @@ sub init_safespace { $safehole->wrap(\&Math::Random::random_set_seed,$safeeval,'&random_set_seed'); $safehole->wrap(\&Apache::lonxml::error,$safeeval,'&LONCAPA_INTERNAL_ERROR'); $safehole->wrap(\&Apache::lonxml::debug,$safeeval,'&LONCAPA_INTERNAL_DEBUG'); + $safehole->wrap(\&Apache::caparesponse::get_sigrange,$safeeval,'&LONCAPA_INTERNAL_get_sigrange'); #need to inspect this class of ops # $safeeval->deny(":base_orig"); @@ -735,7 +744,7 @@ sub init_safespace { my $rndseed; my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser(); $rndseed=&Apache::lonnet::rndseed($symb,$courseid,$domain,$name); - $safeinit .= ';$external::randomseed='.$rndseed.';'; + $safeinit .= ';$external::randomseed="'.$rndseed.'";'; &Apache::lonxml::debug("Setting rndseed to $rndseed"); &Apache::run::run($safeinit,$safeeval); @@ -1086,21 +1095,20 @@ sub storefile { } sub createnewhtml { - my $filecontents=(< - - Title of Document Goes Here - +$title - - Body of Document Goes Here - +$body SIMPLECONTENT - return $filecontents; + return $filecontents; } sub createnewsty { @@ -1121,8 +1129,24 @@ sub inserteditinfo { $filecontents = &HTML::Entities::encode($filecontents,'<>&"'); # my $editheader='Edit below
'; my $xml_help = ''; + my $activate=''; + my $initialize=''; if ($filetype eq 'html') { - $xml_help=Apache::loncommon::helpLatexCheatsheet(); + $initialize=&Apache::lonhtmlcommon::htmlareaheaders().(< + HTMLArea.loadPlugin("FullPage"); + + function initDocument() { + var editor=new HTMLArea("editor"); + editor.registerPlugin(FullPage); + editor.generate(); + } + +FULLPAGE + $result=~s/\]*)\>/\/i; + $xml_help=&Apache::loncommon::helpLatexCheatsheet(); +#FIXME: need to install FullPage plugin during install +# $activate=&Apache::lonhtmlcommon::htmlareaactive(); } my $cleanbut = ''; if ($filetype eq 'html') { @@ -1139,17 +1163,20 @@ $cleanbut BUTTONS my $editfooter=(<
$xml_help $buttons
- +
$buttons
$titledisplay +$activate + ENDFOOTER # $result=~s/(\]*\>)/$1$editheader/is; $result=~s/(\<\/body\>)/$editfooter/is;