--- loncom/interface/lonprintout.pm 2015/03/11 04:15:47 1.627.2.14 +++ loncom/interface/lonprintout.pm 2015/06/04 13:03:36 1.627.2.15 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.627.2.14 2015/03/11 04:15:47 raeburn Exp $ +# $Id: lonprintout.pm,v 1.627.2.15 2015/06/04 13:03:36 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -701,12 +701,12 @@ sub incomplete { } } # -# When printing for students, the resoures and order of the +# When printing for students, the resources and order of the # resources may need to be altered if there are folders with # random selectiopn or random ordering (or both) enabled. # This sub computes the set of resources to print for a student # modified both by random ordering and selection and filtered -# to only those that are in the original set selcted to be printed. +# to only those that are in the original set selected to be printed. # # Parameters: # $map - The URL of the folder being printed. @@ -717,6 +717,9 @@ sub incomplete { # $who - Student/domain for whome the sequence will be generated. # $code - CODE being printed when printing Problems/Resources # from folder for CODEd assignments +# $nohidemap - If true, parameter in map for hiddenresource will be +# ignored. The user calling the routine should have +# both the pav and vgr privileges if this is set to true). # # Implicit inputs: # $ @@ -738,7 +741,7 @@ sub master_seq_to_person_seq { my @output_seq; my $unhidden; - if ($perm{'pav'} && $perm{'vgr'} && $nohidemap) { + if ($nohidemap) { $unhidden = &Apache::lonnet::clutter($map); } @@ -3184,6 +3187,10 @@ ENDPART my $student_counter=-1; my $i = 0; my $last_section = (split(/:/,$students[0]))[2]; + my $nohidemap; + if ($perm{'pav'} && $perm{'vgr'}) { + $nohidemap = 1; + } foreach my $person (@students) { my $duefile="/home/httpd/prtspool/$env{'user.name'}_$env{'user.domain'}_printout.due"; if (-e $duefile) { @@ -3201,7 +3208,7 @@ ENDPART $i=int($student_counter/$helper->{'VARS'}{'NUMBER_TO_PRINT'}); } my $actual_seq = master_seq_to_person_seq($map, \@master_seq, - $person, undef, 1); + $person, undef, $nohidemap); my ($output,$fullname, $printed)=&print_resources($r,$helper, $person,$type, \%moreenv, $actual_seq, @@ -3312,6 +3319,10 @@ ENDPART my $flag_latex_header_remove = 'NO'; my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,$num_todo); my $count=0; + my $nohidemap; + if ($perm{'pav'} && $perm{'vgr'}) { + $nohidemap = 1; + } foreach my $code (sort(@allcodes)) { my $file_num=int($count/$number_per_page); if ($code_type eq 'number') { @@ -3324,7 +3335,7 @@ ENDPART $env{'form.CODE'} = $moreenv{'CODE'}; $actual_seq = master_seq_to_person_seq($map, \@master_seq, undef, - $moreenv{'CODE'}, 1); + $moreenv{'CODE'}, $nohidemap); delete($env{'form.CODE'}); } my ($output,$fullname, $printed)=