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

sakharuk lon-capa-cvs@mail.lon-capa.org
Mon, 10 May 2004 14:25:02 -0000


sakharuk		Mon May 10 10:25:02 2004 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  Syllabus, aboutmepage and bulletinboard all can be printed in sequence. Working on the printing for selected students.
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.300 loncom/interface/lonprintout.pm:1.301
--- loncom/interface/lonprintout.pm:1.300	Thu May  6 02:45:13 2004
+++ loncom/interface/lonprintout.pm	Mon May 10 10:25:02 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.300 2004/05/06 06:45:13 albertel Exp $
+# $Id: lonprintout.pm,v 1.301 2004/05/10 14:25:02 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -676,9 +676,7 @@
 sub unsupported {
     my $currentURL=shift;
     my $result.='\documentclass[letterpaper]{article}\usepackage{calc}\begin{document}Printout of this type of document is currently not supported: ';
-    if ($currentURL=~/\/(aboutme|syllabus|bulletinboard)$/) {
-	$result.='\textbf{'.$1.'}';
-    } elsif ($currentURL=~/\/ext\//) {
+    if ($currentURL=~/\/ext\//) {
 	$result.=' \strut \\\\ THIS IS EXTERNAL RESOURCE WITH URL \strut \\\\ '.$currentURL.' ';
     } else {
 	$result.=$currentURL;
@@ -754,7 +752,6 @@
 	}
 	$selectionmade = 1;
 	if ($currentURL=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) {
-	    &Apache::lonnet::logthis("II AMAM IN A WRONG PLACE");
 	    my $rndseed=time;
 	    my $texversion='';
 	    if ($helper->{'VARS'}->{'ANSWER_TYPE'} ne 'only') {
@@ -877,7 +874,7 @@
 	    }
 	    if ($helper->{VARS}->{'construction'} eq '1') {$result=~s/(\\begin{document})/$1 \\fbox\{RANDOM SEED IS $rndseed\} /;}
 	    $result .= '\end{document}';   
-	} elsif ($currentURL=~/\/(smppg|syllabus)$/) { 
+	} elsif ($currentURL=~/\/(smppg|syllabus|aboutme|bulletinboard)$/) { 
 		my %form;
 		$form{'grade_target'}='tex';
 		$form{'textwidth'}=&get_textwidth($helper,$LaTeXwidth);
@@ -886,7 +883,6 @@
 		my $texversion=&Apache::lonnet::ssi($currentURL,%form);
 		$result .= $texversion;
 	} else {
-	    &Apache::lonnet::logthis("IIII AMAM IN A WRONG PLACE");
 	    $result.=&unsupported($currentURL);
 	}
     } elsif (($helper->{'VARS'}->{'PRINT_TYPE'} eq 'map_problems') or
@@ -975,6 +971,20 @@
 		}
 		$result .= $texversion;
 		$flag_latex_header_remove = 'YES';   
+	    } elsif ($urlp=~/\/(smppg|syllabus|aboutme|bulletinboard)$/) { 
+		my %form;
+		$form{'grade_target'}='tex';
+		$form{'textwidth'}=&get_textwidth($helper,$LaTeXwidth);
+		$form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'};
+		if ($urlp=~/\/syllabus$/) {$urlp=~s/\/res//;}
+		my $texversion=&Apache::lonnet::ssi($urlp,%form);
+		if ($flag_latex_header_remove ne 'NO') {
+		    $texversion = &latex_header_footer_remove($texversion);
+		} else {
+		    $texversion =~ s/\\end{document}/\\vskip 0\.5mm\\noindent\\makebox\[\\textwidth\/\$number_of_columns\]\[b\]\{\\hrulefill\}/;
+		}
+		$result .= $texversion;
+		$flag_latex_header_remove = 'YES'; 
 	    } else {
 		$texversion=&unsupported($urlp);
 		if ($flag_latex_header_remove ne 'NO') {