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

raeburn raeburn at source.lon-capa.org
Sat Apr 2 15:14:31 EDT 2022


raeburn		Sat Apr  2 19:14:31 2022 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  - Bug 4500 
    The value set for "Allow problems to be split over pages" can now be 
    accessed within the &encapsulate_minipage() routine. 
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.675 loncom/interface/lonprintout.pm:1.676
--- loncom/interface/lonprintout.pm:1.675	Wed Feb  9 15:46:57 2022
+++ loncom/interface/lonprintout.pm	Sat Apr  2 19:14:31 2022
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.675 2022/02/09 15:46:57 raeburn Exp $
+# $Id: lonprintout.pm,v 1.676 2022/04/02 19:14:31 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1339,8 +1339,8 @@
 #  necessity is determined by the problem_split param.
 #
 sub encapsulate_minipage {
-    my ($text) = @_;
-    if (!($env{'form.problem.split'} =~ /yes/i)) {
+    my ($text,$problem_split) = @_;
+    if (!($problem_split =~ /yes/i)) {
 	$text = '\begin{minipage}{\textwidth}'.$text.'\end{minipage}';
     }
     return $text;
@@ -2549,7 +2549,7 @@
 		    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);
+		    $body = &encapsulate_minipage($body,$answerform{'problem_split'});
 		    $texversion.=$body;
 		}
 	    }
@@ -3014,7 +3014,7 @@
 			    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);
+			    $body    = &encapsulate_minipage($body,$answerform{'problem_split'});
 			    $texversion .= $body;
 			} else {
 			    $texversion='';
@@ -3727,7 +3727,7 @@
 			    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);
+			    $body     = &encapsulate_minipage($body,$answerenv{'problem_split'});
 			    $rendered = $header.$body;
 			}
 		    }
@@ -3817,7 +3817,7 @@
             $message = &mt('No incomplete resources');
         }
         if ($message) { 
-	    $current_output  = &encapsulate_minipage("\\vskip -10mm \n$message\n \\vskip 100 mm { }\n");
+	    $current_output  = &encapsulate_minipage("\\vskip -10mm \n$message\n \\vskip 100 mm { }\n",$moreenv->{'problem_split'});
         }
 	if ($remove_latex_header eq "NO") {
 	    $current_output = &print_latex_header() . $current_output;




More information about the LON-CAPA-cvs mailing list