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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 17 Feb 2004 16:24:24 -0000


albertel		Tue Feb 17 11:24:24 2004 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  - 'all' is more descriptive that 0 when selecting to put all of the student into 1 pdf file
  - better text for the PDF link when printing just one PDF file for all students
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.277 loncom/interface/lonprintout.pm:1.278
--- loncom/interface/lonprintout.pm:1.277	Mon Feb 16 19:26:20 2004
+++ loncom/interface/lonprintout.pm	Tue Feb 17 11:24:24 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.277 2004/02/17 00:26:20 albertel Exp $
+# $Id: lonprintout.pm,v 1.278 2004/02/17 16:24:24 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -982,7 +982,10 @@
 	     $selectionmade=8;
 	 }
 	 my @students=split /\|\|\|/, $helper->{'VARS'}->{'STUDENTS'};
-         if ($helper->{'VARS'}->{'NUMBER_TO_PRINT'} eq '0') {$helper->{'VARS'}->{'NUMBER_TO_PRINT'}=$#students+1;}
+         if ($helper->{'VARS'}->{'NUMBER_TO_PRINT'} eq '0' ||
+	     $helper->{'VARS'}->{'NUMBER_TO_PRINT'} eq 'all' ) {
+	     $helper->{'VARS'}->{'NUMBER_TO_PRINT'}=$#students+1;
+	 }
 	 my @master_seq=split /\|\|\|/, $helper->{'VARS'}->{'RESOURCES'};
 	 #loop over students
 	 my $flag_latex_header_remove = 'NO'; 
@@ -1193,10 +1196,14 @@
 	    $student_names.=$student_names[$i].'_ENDPERSON_';
 	}
     } else {
-	my $fullname = &get_name($ENV{'user.name'},$ENV{'user.domain'});
-	$student_names=join(':',$ENV{'user.name'},$ENV{'user.domain'},
-			    $ENV{'request.course.sec'},$fullname).
-				'_ENDPERSON_'.'_END_';
+	if ($#student_names>-1) {
+	    $student_names=$student_names[0].'_ENDPERSON_';
+	} else {
+	    my $fullname = &get_name($ENV{'user.name'},$ENV{'user.domain'});
+	    $student_names=join(':',$ENV{'user.name'},$ENV{'user.domain'},
+				$ENV{'request.course.sec'},$fullname).
+				    '_ENDPERSON_'.'_END_';
+	}
     }
 
     my $URLback=''; #link to original document
@@ -1502,7 +1509,7 @@
         $paramHash = Apache::lonhelper::getParamHash();
 	$paramHash->{'variable'} = 'NUMBER_TO_PRINT';   
 	$helper->declareVar('NUMBER_TO_PRINT');         
-	addMessage("<input type='text' name='NUMBER_TO_PRINT.forminput' size='3' value='0' /><hr width='33%' />");
+	addMessage("<input type='text' name='NUMBER_TO_PRINT.forminput' size='3' value='all' /><hr width='33%' />");
 
 	if ($helper->{VARS}->{'assignment'}) {
 	    push @{$printChoices}, ["<b>Resources</b> from <b><i>$sequenceTitle</i></b> for <b>selected students</b>", 'resources_for_students', 'CHOOSE_STUDENTS1'];
@@ -1530,7 +1537,7 @@
         $paramHash = Apache::lonhelper::getParamHash();
 	$paramHash->{'variable'} = 'NUMBER_TO_PRINT';   
 	$helper->declareVar('NUMBER_TO_PRINT');         
-	addMessage("<input type='text' name='NUMBER_TO_PRINT.forminput' size='3' value='0' /><hr width='33%' />");
+	addMessage("<input type='text' name='NUMBER_TO_PRINT.forminput' size='3' value='all' /><hr width='33%' />");
     }
 
     # FIXME: That RE should come from a library somewhere.