--- loncom/xml/lonxml.pm 2003/02/19 15:20:35 1.237 +++ loncom/xml/lonxml.pm 2003/03/25 22:51:48 1.241 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.237 2003/02/19 15:20:35 sakharuk Exp $ +# $Id: lonxml.pm,v 1.241 2003/03/25 22:51:48 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -458,19 +458,19 @@ sub htmlclean { sub latex_special_symbols { my ($current_token,$stack,$parstack,$where)=@_; if ($where eq 'header') { - $current_token =~ s/(\\|_|^)/ /g; - $current_token =~ s/(\$|%|\#|&|\{|\})/\\$1/g; + $current_token =~ s/(\\|_|\^)/ /g; + $current_token =~ s/(\$|%|\#|&|\{|\})/\\$1/g; } else { - $current_token=~s/\\ /\\char92 /g; - $current_token=~s/\^/\\char94 /g; - $current_token=~s/\~/\\char126 /g; - $current_token=~s/(&[^a-z\#])/\\$1/g; - $current_token=~s/([^&])\#/$1\\#/g; - $current_token=~s/(\$|_|{|})/\\$1/g; - $current_token=~s/\\char92 /\\texttt{\\char92}/g; - $current_token=~s/(>|<)/\$$1\$/g; #more or less - if ($current_token=~m/\d%/) {$current_token =~ s/(\d)%/$1\\%/g;} #percent after digit - if ($current_token=~m/\s%/) {$current_token =~ s/(\s)%/$1\\%/g;} #persent after space + $current_token=~s/\\ /\\char92 /g; + $current_token=~s/\^/\\char94 /g; + $current_token=~s/\~/\\char126 /g; + $current_token=~s/(&[^a-z\#])/\\$1/g; + $current_token=~s/([^&])\#/$1\\#/g; + $current_token=~s/(\$|_|{|})/\\$1/g; + $current_token=~s/\\char92 /\\texttt{\\char92}/g; + $current_token=~s/(>|<)/\$$1\$/g; #more or less + if ($current_token=~m/\d%/) {$current_token =~ s/(\d)%/$1\\%/g;} #percent after digit + if ($current_token=~m/\s%/) {$current_token =~ s/(\s)%/$1\\%/g;} #persent after space } return $current_token; } @@ -486,7 +486,8 @@ sub inner_xmlparse { if ($metamode<1) { my $text=$token->[1]; if ($token->[0] eq 'C' && $target eq 'tex') { - $text = '%'.$text."\n"; + $text = ''; +# $text = '%'.$text."\n"; } $result.=$text; } @@ -794,7 +795,7 @@ sub default_homework_load { my ($safeeval)=@_; &Apache::lonxml::debug('Loading default_homework'); my $default=&Apache::lonnet::getfile('/home/httpd/html/res/adm/includes/default_homework.lcpm'); - if ($default == -1) { + if ($default eq -1) { &Apache::lonxml::error("Unable to find default_homework.lcpm"); } else { &Apache::run::run($default,$safeeval); @@ -1099,6 +1100,13 @@ sub inserteditinfo { my ($result,$filecontents)=@_; $filecontents = &HTML::Entities::encode($filecontents); # my $editheader='Edit below
'; + my $xml_help = '
'. + &Apache::loncommon::help_open_topic("Greek_Symbols",'Greek Symbols', + undef,undef,600) + .''. + &Apache::loncommon::help_open_topic("Other_Symbols",'Other Symbols', + undef,undef,600) + .'
'; my $buttons=(< @@ -1109,6 +1117,7 @@ BUTTONS
+$xml_help $buttons
@@ -1178,7 +1187,7 @@ sub handler { my %mystyle; my $result = ''; my $filecontents=&Apache::lonnet::getfile($file); - if ($filecontents == -1) { + if ($filecontents eq -1) { $result=(<