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

sakharuk lon-capa-cvs@mail.lon-capa.org
Tue, 08 Jun 2004 14:55:22 -0000


sakharuk		Tue Jun  8 10:55:22 2004 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  Batchmode restored in printing resources from some sequence in the case if the first resource is external document.
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.306 loncom/interface/lonprintout.pm:1.307
--- loncom/interface/lonprintout.pm:1.306	Mon Jun  7 15:08:36 2004
+++ loncom/interface/lonprintout.pm	Tue Jun  8 10:55:22 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.306 2004/06/07 19:08:36 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.307 2004/06/08 14:55:22 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -674,8 +674,9 @@
 
 
 sub unsupported {
-    my $currentURL=shift;
-    my $result.='\documentclass[letterpaper]{article}\usepackage{calc}\begin{document}Printout of this type of document is currently not supported: ';
+    my ($currentURL,$mode)=@_;
+    if ($mode ne '') {$mode='\\'.$mode}
+    my $result.='\documentclass[letterpaper]{article}'.$mode.'\usepackage{calc}\begin{document}Printout of this type of document is currently not supported: ';
     if ($currentURL=~/\/ext\//) {
 	$result.=' \strut \\\\ THIS IS EXTERNAL RESOURCE WITH URL \strut \\\\ '.$currentURL.' ';
     } else {
@@ -883,7 +884,7 @@
 		my $texversion=&Apache::lonnet::ssi($currentURL,%form);
 		$result .= $texversion;
 	} else {
-	    $result.=&unsupported($currentURL);
+	    $result.=&unsupported($currentURL,$helper->{'VARS'}->{'LATEX_TYPE'});
 	}
     } elsif (($helper->{'VARS'}->{'PRINT_TYPE'} eq 'map_problems') or
              ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'map_problems_pages') or
@@ -944,7 +945,7 @@
 		    if ($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') {
 			$texversion=~s/(\\keephidden{ENDOFPROBLEM})/$answer$1/;
 		    } else {
-			if ($urlp=~/\.(problem|exam|quiz|library)$/) {
+			if ($urlp=~/\.(problem|exam|quiz|assess|survey|form|library)$/) {
 			    $texversion=&print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'});
 			    $texversion.='\vskip 0 mm \noindent\textbf{'.&Apache::lonnet::gettitle($urlp).'}\vskip 0 mm ';
 			    $texversion.=&path_to_problem ($urlp,$LaTeXwidth);
@@ -986,7 +987,7 @@
 		$result .= $texversion;
 		$flag_latex_header_remove = 'YES'; 
 	    } else {
-		$texversion=&unsupported($urlp);
+		$texversion=&unsupported($urlp,$helper->{'VARS'}->{'LATEX_TYPE'});
 		if ($flag_latex_header_remove ne 'NO') {
 		    $texversion = &latex_header_footer_remove($texversion);
 		} else {
@@ -1331,7 +1332,7 @@
 		    }
 		    $current_output .= $rendered.'\vskip 0.5mm\noindent\makebox[\textwidth/$number_of_columns][b]{\hrulefill}\strut \vskip 0 mm \strut ';
 		} else {
-		    my $rendered = &unsupported($res_url);
+		    my $rendered = &unsupported($res_url,$helper->{'VARS'}->{'LATEX_TYPE'});
 		    if ($remove_latex_header ne 'NO') {
 			$rendered = &latex_header_footer_remove($rendered);
 		    } else {