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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 12 Aug 2004 06:31:09 -0000


albertel		Thu Aug 12 02:31:09 2004 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  - BUG#3214, when doing anonymous printouts add a Name: section to the header
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.319 loncom/interface/lonprintout.pm:1.320
--- loncom/interface/lonprintout.pm:1.319	Wed Aug  4 14:18:40 2004
+++ loncom/interface/lonprintout.pm	Thu Aug 12 02:31:09 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.319 2004/08/04 18:18:40 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.320 2004/08/12 06:31:09 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1304,7 +1304,9 @@
     my $current_output = ''; 
     my ($username,$userdomain,$usersection) = split /:/,$person;
     my $fullname = &get_name($username,$userdomain);
+    my $namepostfix;
     if ($person =~ 'anon') {
+	$namepostfix="\\\\Name: ";
 	$fullname = "CODE - ".$moreenv->{'CODE'};
     }
     #goes through all resources, checks if they are available for 
@@ -1378,11 +1380,11 @@
     if ($usersection ne '') {$courseidinfo.=' - Sec. '.$usersection}
     my $currentassignment=&Apache::lonxml::latex_special_symbols($helper->{VARS}->{'assignment'},'header');
     if ($current_output=~/\\documentclass/) {
-	$current_output =~ s/\\begin{document}/\\setlength{\\topmargin}{1cm} \\begin{document}\\noindent\\lhead{\\textit{\\textbf{$fullname}}$courseidinfo \\hfill \\thepage \\\\ \\textit{$currentassignment}}\\vskip 3 mm /;
+	$current_output =~ s/\\begin{document}/\\setlength{\\topmargin}{1cm} \\begin{document}\\noindent\\lhead{\\textit{\\textbf{$fullname}}$courseidinfo \\hfill \\thepage \\\\ \\textit{$currentassignment}$namepostfix}\\vskip 3 mm /;
     } else {
 	my $blankpages = '';
 	for (my $j=0;$j<$helper->{'VARS'}->{'EMPTY_PAGES'};$j++) {$blankpages.='\clearpage\strut\clearpage';}
-	$current_output = '\strut\vspace*{-6 mm}\\newline\\noindent\\makebox[\\textwidth/$number_of_columns][b]{\\hrulefill}\vspace*{-2 mm}\\newline\\noindent{\\tiny Printed from LON-CAPA\\copyright MSU{\\hfill} Licensed under GNU General Public License }\\newpage '.$blankpages.'\setcounter{page}{1}\noindent\parbox{\minipagewidth}{\noindent\\lhead{\\textit{\\textbf{'.$fullname.'}}'.$courseidinfo.' \\hfill \\thepage \\\\ \\textit{'.$currentassignment.'}}} \vskip -5 mm '.$current_output;
+	$current_output = '\strut\vspace*{-6 mm}\\newline\\noindent\\makebox[\\textwidth/$number_of_columns][b]{\\hrulefill}\vspace*{-2 mm}\\newline\\noindent{\\tiny Printed from LON-CAPA\\copyright MSU{\\hfill} Licensed under GNU General Public License }\\newpage '.$blankpages.'\setcounter{page}{1}\noindent\parbox{\minipagewidth}{\noindent\\lhead{\\textit{\\textbf{'.$fullname.'}}'.$courseidinfo.' \\hfill \\thepage \\\\ \\textit{'.$currentassignment.'}'.$namepostfix.'}} \vskip -5 mm '.$current_output;
     }
     return ($current_output,$fullname);