[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 08 Aug 2006 17:32:06 -0000


albertel		Tue Aug  8 13:32:06 2006 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  - bug#4955 answer only mode was not properly escaping problem titles
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.476 loncom/interface/lonprintout.pm:1.477
--- loncom/interface/lonprintout.pm:1.476	Wed Aug  2 22:36:56 2006
+++ loncom/interface/lonprintout.pm	Tue Aug  8 13:32:02 2006
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.476 2006/08/03 02:36:56 albertel Exp $
+# $Id: lonprintout.pm,v 1.477 2006/08/08 17:32:02 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1119,7 +1119,9 @@
 		    # If necessary, encapsulate answer in minipage:
 		    
 		    $texversion=&print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'});
-		    my $body ='\vskip 0 mm \noindent\textbf{'.&Apache::lonnet::gettitle($helper->{'VARS'}->{'symb'}).'}\vskip 0 mm ';
+		    my $title = &Apache::lonnet::gettitle($helper->{'VARS'}->{'symb'});
+		    $title = &Apache::lonxml::latex_special_symbols($title);
+		    my $body ='\vskip 0 mm \noindent\textbf{'.$title.'}\vskip 0 mm ';
 		    $body.=&path_to_problem($urlp,$LaTeXwidth);
 		    $body.='\vskip 1 mm '.$answer.'\end{document}';
 		    $body = &encapsulate_minipage($body);
@@ -1314,7 +1316,9 @@
 		} else {
 		    $texversion=&print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'});
 		    if ($helper->{'VARS'}->{'construction'} ne '1') {
-			$texversion.='\vskip 0 mm \noindent\textbf{'.&Apache::lonnet::gettitle($helper->{'VARS'}->{'symb'}).'}\vskip 0 mm ';
+			my $title = &Apache::lonnet::gettitle($helper->{'VARS'}->{'symb'});
+			$title = &Apache::lonxml::latex_special_symbols($title);
+			$texversion.='\vskip 0 mm \noindent\textbf{'.$title.'}\vskip 0 mm ';
 			$texversion.=&path_to_problem($cleanURL,$LaTeXwidth);
 		    } else {
 			$texversion.='\vskip 0 mm \noindent\textbf{Prints from construction space - there is no title.}\vskip 0 mm ';
@@ -1435,7 +1439,9 @@
 		    } else {
 			if ($urlp=~/\.(problem|exam|quiz|assess|survey|form|library)$/) {
 			    $texversion=&print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'});
-			    my $body ='\vskip 0 mm \noindent\textbf{'.&Apache::lonnet::gettitle($master_seq[$i]).'}\vskip 0 mm ';
+			    my $title = &Apache::lonnet::gettitle($master_seq[$i]);
+			    $title = &Apache::lonxml::latex_special_symbols($title);
+			    my $body ='\vskip 0 mm \noindent\textbf{'.$title.'}\vskip 0 mm ';
 			    $body   .= &path_to_problem ($urlp,$LaTeXwidth);
 			    $body   .='\vskip 1 mm '.$answer;
 			    $body    = &encapsulate_minipage($body);
@@ -1952,8 +1958,10 @@
 
 			    
 			    my $header =&print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'});
-			    my $body   ='\vskip 0 mm \noindent\textbf{'.&Apache::lonnet::gettitle($curresline).'}\vskip 0 mm ';
-			    $body     .=&path_to_problem($res_url,$LaTeXwidth);			    
+			    my $title = &Apache::lonnet::gettitle($curresline);
+			    $title = &Apache::lonxml::latex_special_symbols($title);
+			    my $body   ='\vskip 0 mm \noindent\textbf{'.$title.'}\vskip 0 mm ';
+			    $body     .=&path_to_problem($res_url,$LaTeXwidth);
 			    $body     .='\vskip 1 mm '.$ansrendered;
 			    $body     = &encapsulate_minipage($body);
 			    $rendered = $header.$body;