--- loncom/xml/lonxml.pm 2013/09/21 14:33:13 1.543 +++ loncom/xml/lonxml.pm 2014/06/21 20:56:40 1.547 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.543 2013/09/21 14:33:13 raeburn Exp $ +# $Id: lonxml.pm,v 1.547 2014/06/21 20:56:40 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -144,7 +144,7 @@ $metamode = 0; # turns on and of run::evaluate actually derefencing var refs $evaluate = 1; -# data structure for eidt mode, determines what tags can go into what other tags +# data structure for edit mode, determines what tags can go into what other tags %insertlist=(); # stores the list of active tag namespaces @@ -306,8 +306,12 @@ sub xmlparse { &clean_safespace($safeeval); if (@script_var_displays) { - my $scriptoutput = join('',@script_var_displays); - $finaloutput=~s{(\s*)\s*$}{$scriptoutput$1}s; + if ($finaloutput =~ m{\s*\s*$}s) { + my $scriptoutput = join('',@script_var_displays); + $finaloutput=~s{(\s*)\s*$}{$scriptoutput$1}s; + } else { + $finaloutput .= join('',@script_var_displays); + } undef(@script_var_displays); } &init_state(); @@ -651,7 +655,7 @@ sub init_safespace { my ($target,$safeeval,$safehole,$safeinit) = @_; $safeeval->reval('use LaTeX::Table;'); $safeeval->deny_only(':dangerous'); - $safeeval->reval('use Math::Complex;'); + $safeeval->reval('use LONCAPA::LCMathComplex;'); $safeeval->permit_only(":default"); $safeeval->permit("entereval"); $safeeval->permit(":base_math"); @@ -1359,7 +1363,9 @@ sub do_registered_ssi { sub add_script_result { my ($display) = @_; - push(@script_var_displays, $display); + if ($display ne '') { + push(@script_var_displays, $display); + } } # @@ -1569,7 +1575,11 @@ FULLPAGE $add_to_onresize = "resize_textarea('$textarea_id','LC_aftertextarea');"; if ($filetype eq 'html') { - $xml_help=&Apache::loncommon::helpLatexCheatsheet(); + my $not_author; + if ($uri =~ m{^/uploaded/}) { + $not_author = 1; + } + $xml_help=&Apache::loncommon::helpLatexCheatsheet(undef,undef,$not_author); } my $titledisplay=&display_title(); @@ -1593,6 +1603,10 @@ FULLPAGE } } } + my $undo; + unless ($uri =~ m{^/uploaded/}) { + $undo = ''."\n"; + } my $editfooter=(< @@ -1606,8 +1620,7 @@ $initialize
- - $htmlerror $deps_button $dragmath_button + $undo $htmlerror $deps_button $dragmath_button
@@ -2287,7 +2300,7 @@ sub description { sub helpinfo { my ($token)=@_; my $tag = &get_tag($token); - return ($insertlist{$tag.'.helpfile'}, $insertlist{$tag.'.helpdesc'}); + return ($insertlist{$tag.'.helpfile'}, &mt($insertlist{$tag.'.helpdesc'})); } sub get_tag {