--- loncom/xml/lonxml.pm 2002/07/15 19:45:18 1.181 +++ loncom/xml/lonxml.pm 2002/08/23 19:10:32 1.188 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.181 2002/07/15 19:45:18 www Exp $ +# $Id: lonxml.pm,v 1.188 2002/08/23 19:10:32 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -176,6 +176,7 @@ sub xmlend { unless (($hidden) && (!$seeid)) { my $message=$contrib{$idx.':message'}; $message=~s/\n/\<br \/\>/g; + $message=&Apache::lontexconvert::msgtexconverted($message); if ($message) { if ($hidden) { $message='<font color="#888888">'.$message.'</font>'; @@ -332,7 +333,8 @@ sub registerurl { my $target = shift; my $result = ''; if ($target eq 'edit') { - $result .="<script>\n menu.currentURL=null;\n". + $result .="<script>\n". + "if (typeof menu != 'undefined') {menu.currentURL=null;}\n". &Apache::loncommon::browser_and_searcher_javascript(). "\n</script>\n"; } @@ -384,7 +386,7 @@ ENDPARM menu.switchbutton (8,1,'eval.gif','evaluate','this','gopost("/adm/evaluate",currentURL)'); menu.switchbutton - (8,2,'fdbk.gif','feedback','on this','gopost("/adm/feedback",currentURL)'); + (8,2,'fdbk.gif','feedback','discuss','gopost("/adm/feedback",currentURL)'); menu.switchbutton (8,3,'prt.gif','prepare','printout','gopost("/adm/printout",currentURL)'); menu.switchbutton @@ -537,6 +539,23 @@ sub htmlclean { return $output; } +sub latex_special_sumbols { + my ($current_token,$stack,$parstack)=@_; + my @temp_array = @$stack; + if ($temp_array[-1] ne 'tt') { + if ($current_token=~m/\^/) {$current_token=~s/\^/\\verb|\^|/g;} + } else { + if ($current_token=~m/\^/) {$current_token=~s/\^/}\\verb|\^|{/g;} + } + if ($current_token=~m/>/) {$current_token=~s/>/\$>\$/g;} + if ($current_token=~m/</) {$current_token=~s/</\$<\$/g;} + if ($current_token=~m/\d%/) {$current_token =~ s/%/\\%/g;} + if ($current_token=~m/\s%/) {$current_token =~ s/%/\\%/g;} + +# $current_token = ' start='.$current_token.'=finish '; + return $current_token; +} + sub inner_xmlparse { my ($target,$stack,$parstack,$pars,$safeeval,$style_for_target)=@_; my $finaloutput = ''; @@ -546,7 +565,11 @@ sub inner_xmlparse { while ($token = $$pars['-1']->get_token) { if (($token->[0] eq 'T') || ($token->[0] eq 'C') || ($token->[0] eq 'D') ) { if ($metamode<1) { - $result=$token->[1]; + if ($target eq 'tex') { + $result.=&latex_special_sumbols($token->[1],$stack,$parstack); + } else { + $result.=$token->[1]; + } } } elsif ($token->[0] eq 'PI') { if ($metamode<1) {