--- loncom/interface/lonprintout.pm 2004/02/17 00:26:20 1.277 +++ loncom/interface/lonprintout.pm 2004/02/17 16:24:24 1.278 @@ -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 @@ ENDPART $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 @@ ENDPART $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 @@ CHOOSE_STUDENTS $paramHash = Apache::lonhelper::getParamHash(); $paramHash->{'variable'} = 'NUMBER_TO_PRINT'; $helper->declareVar('NUMBER_TO_PRINT'); - addMessage("
"); + addMessage("
"); if ($helper->{VARS}->{'assignment'}) { push @{$printChoices}, ["Resources from $sequenceTitle for selected students", 'resources_for_students', 'CHOOSE_STUDENTS1']; @@ -1530,7 +1537,7 @@ CHOOSE_STUDENTS1 $paramHash = Apache::lonhelper::getParamHash(); $paramHash->{'variable'} = 'NUMBER_TO_PRINT'; $helper->declareVar('NUMBER_TO_PRINT'); - addMessage("
"); + addMessage("
"); } # FIXME: That RE should come from a library somewhere.