--- loncom/interface/lonprintout.pm 2003/06/23 19:22:00 1.193 +++ loncom/interface/lonprintout.pm 2003/06/24 20:21:05 1.196 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.193 2003/06/23 19:22:00 sakharuk Exp $ +# $Id: lonprintout.pm,v 1.196 2003/06/24 20:21:05 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -657,6 +657,8 @@ ENDPART # my ($usersection,$username,$userdomain) = split /:/,$person; my ($username,$userdomain) = split /:/,$person; my $fullname = &get_name($username,$userdomain); + + if ($parmhash{'anonimous_quiz'}=~/yes/) {$fullname=' ';} #put here something reasonable for annonimous exams or quiz #goes through all resources, checks if they are available for current student, and produces output foreach my $curresline (@master_seq) { if ($curresline=~ m/\.(problem|exam|quiz|assess|survey|form|library)$/) { @@ -761,12 +763,12 @@ ENDPART $result = &page_format_transformation($papersize,$laystyle,$numberofcolumns,$helper->{'VARS'}->{'PRINT_TYPE'},$result,$helper->{VARS}->{'assignment'}); $result = &latex_corrections($number_of_columns,$result); #changes page's parameters for the one column output -# if ($numberofcolumns == 1) { -# $result =~ s/\\textwidth= 9cm/\\textwidth= $ENV{'form.width'}/; -# $result =~ s/\\textheight 25\.9cm/\\textheight $ENV{'form.height'}/; -# $result =~ s/\\evensidemargin = -0\.57in/\\evensidemargin= $ENV{'form.leftmargin'}/; -# $result =~ s/\\oddsidemargin = -0\.57in/\\oddsidemargin= $ENV{'form.leftmargin'}/; -# } + if ($numberofcolumns == 1) { + $result =~ s/\\textwidth= 9cm/\\textwidth= $helper->{'VARS'}->{'pagesize.width'} $helper->{'VARS'}->{'pagesize.widthunit'} /; + $result =~ s/\\textheight 25\.9cm/\\textheight $helper->{'VARS'}->{'pagesize.height'} $helper->{'VARS'}->{'pagesize.heightunit'} /; + $result =~ s/\\evensidemargin = -0\.57in/\\evensidemargin= $helper->{'VARS'}->{'pagesize.lmargin'} $helper->{'VARS'}->{'pagesize.lmarginunit'} /; + $result =~ s/\\oddsidemargin = -0\.57in/\\oddsidemargin= $helper->{'VARS'}->{'pagesize.lmargin'} $helper->{'VARS'}->{'pagesize.lmarginunit'} /; + } #-- writing .tex file in prtspool my $temp_file; my $filename = "/home/httpd/prtspool/$ENV{'user.name'}_$ENV{'user.domain'}_printout_".time."_".rand(10000000).".tex"; @@ -1023,7 +1025,7 @@ CHOOSE_STUDENTS } # FIXME: That RE should come from a library somewhere. - if (((&Apache::lonnet::allowed('bre',$subdir) eq 'F') and ($helper->{VARS}->{'postdata'}=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)/)) or defined $helper->{'VARS'}->{'construction'}) { + if ((((&Apache::lonnet::allowed('bre',$subdir) eq 'F') and ($helper->{VARS}->{'postdata'}=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)/)) or defined $helper->{'VARS'}->{'construction'}) and $ENV{'request.role.adv'}) { push @{$printChoices}, ["Problems from current subdirectory $subdir", 'problems_from_directory', 'CHOOSE_FROM_SUBDIR']; my $f = '$filename';