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

raeburn raeburn at source.lon-capa.org
Sat Feb 8 18:52:04 EST 2014


raeburn		Sat Feb  8 23:52:04 2014 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	lonprintout.pm 
  Log:
  - For 2.11
    - Backport 1.639
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.627.2.9 loncom/interface/lonprintout.pm:1.627.2.10
--- loncom/interface/lonprintout.pm:1.627.2.9	Mon Jan 20 06:09:58 2014
+++ loncom/interface/lonprintout.pm	Sat Feb  8 23:52:03 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.627.2.9 2014/01/20 06:09:58 raeburn Exp $
+# $Id: lonprintout.pm,v 1.627.2.10 2014/02/08 23:52:03 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3618,6 +3618,7 @@
     #
 
     my $syllabus_first = 0;
+    my $assessment_first = 0;
     my $current_assignment = "";
     my $assignment;
     my $courseidinfo = &get_course();
@@ -3641,7 +3642,11 @@
 	    if ($print_incomplete && !&incomplete($username, $userdomain, $res_url)) {
 		next;
 	    }
+            if ((!$actually_printed) && ($curresline =~ m/$LONCAPA::assess_re/)) {
+                $assessment_first = 1;
+            }
 	    $actually_printed++; # we're going to print one.
+
 	    if (&Apache::lonnet::allowed('bre',$res_url)) {
 		if ($res_url!~m|^ext/|
 		    && $res_url=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) {
@@ -3774,32 +3779,26 @@
     if ($syllabus_first) {
         $current_output =~ s/\\\\ Last updated:/Last updated:/
     }
-    if (0) {
-	my $currentassignment=&Apache::lonxml::latex_special_symbols($helper->{VARS}->{'assignment'},'header');
-	my $header_line =
+    my $newheader;
+    unless ($assessment_first) {
+        my $currentassignment=&Apache::lonxml::latex_special_symbols($helper->{VARS}->{'assignment'},'header');
+        my $header_line =
 	    &format_page_header($LaTeXwidth, $parmhash{'print_header_format'},
 				$currentassignment, $courseidinfo, $fullname);
 	my $header_start = ($columns_in_format == 1) ? '\lhead'
 	    : '\fancyhead[LO]';
-	$header_line = $header_start.'{'.$header_line.'}';
+	$newheader = $header_start.'{'.$header_line.'}';
     }
     if ($current_output=~/\\documentclass/) {
-#	$current_output =~ s/\\begin{document}/\\setlength{\\topmargin}{1cm} \\begin{document}\\noindent\\parbox{\\minipagewidth}{\\noindent$header_line$namepostfix}\\vskip 5 mm /;
-	$current_output =~ s/\\begin{document}/\\setlength{\\topmargin}{1cm} \\begin{document}\\noindent\\parbox{\\minipagewidth}{\\noindent$namepostfix}\\vskip 5 mm /;
-
+	$current_output =~ s/\\begin{document}/\\setlength{\\topmargin}{1cm} \\begin{document}\\noindent\\parbox{\\minipagewidth}{\\noindent$newheader$namepostfix}\\vskip 5 mm /;
     } else {
 	my $blankpages = 
 	    '\clearpage\strut\clearpage'x$helper->{'VARS'}->{'EMPTY_PAGES'};
 	
-#	$current_output = '\strut\vspace*{-6 mm}\\newline'.
-#	    &copyright_line().' \newpage '.$blankpages.$end_of_student.
-#	    '\setcounter{page}{1}\noindent\parbox{\minipagewidth}{\noindent'.
-#	    $header_line.$namepostfix. '} \vskip 5 mm '.$current_output;
 	$current_output = '\strut\vspace*{-6 mm}\\newline'.
 	    &copyright_line().' \newpage '.$blankpages.$end_of_student.
-	    '\setcounter{page}{1}\noindent\parbox{\minipagewidth}{\noindent'
-	    .$namepostfix. '} \vskip 5 mm '.$current_output;
-
+	    '\setcounter{page}{1}\noindent\parbox{\minipagewidth}{\noindent'.
+	    $newheader.$namepostfix. '} \vskip 5 mm '.$current_output;
     }
     #
     #  Close the student bracketing.




More information about the LON-CAPA-cvs mailing list