--- loncom/interface/lonprintout.pm 2008/11/04 14:13:16 1.545 +++ loncom/interface/lonprintout.pm 2008/12/21 16:29:56 1.545.2.2 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.545 2008/11/04 14:13:16 bisitz Exp $ +# $Id: lonprintout.pm,v 1.545.2.2 2008/12/21 16:29:56 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1505,7 +1505,7 @@ ENDPART my ($result,$selectionmade) = ('',''); my $number_of_columns = 1; #used only for pages to determine the width of the cell my @temporary_array=split /\|/,$format_from_helper; - my ($laystyle,$numberofcolumns,$papersize,$pdfFormFields)=@temporary_array; + my ($laystyle,$numberofcolumns,$papersize)=@temporary_array; if ($laystyle eq 'L') { $laystyle='album'; } else { @@ -1526,7 +1526,6 @@ ENDPART my %form; $form{'grade_target'} = 'tex'; $form{'textwidth'} = &get_textwidth($helper, $LaTeXwidth); - $form{'pdfFormFields'} = $pdfFormFields; # If form.showallfoils is set, then request all foils be shown: # privilege will be enforced both by not allowing the @@ -2487,17 +2486,23 @@ sub get_randomly_ordered_warning { my $postdata = $env{'form.postdata'} || $helper->{VARS}{'postdata'}; my $navmap = Apache::lonnavmaps::navmap->new(); - my $res = $navmap->getResourceByUrl($map); - if ($res) { - my $func = - sub { return ($_[0]->is_map() && $_[0]->randomorder); }; - my @matches = $navmap->retrieveResources($res, $func,1,1,1); - if (@matches) { - $message = "Some of the items below are in folders set to be randomly ordered. However, when printing the contents of these folders, they will be printed in the original order for all students, not the randomized order."; - } - } - if ($message) { - return ''.$message.''; + if (defined($navmap)) { + my $res = $navmap->getResourceByUrl($map); + if ($res) { + my $func = + sub { return ($_[0]->is_map() && $_[0]->randomorder); }; + my @matches = $navmap->retrieveResources($res, $func,1,1,1); + if (@matches) { + $message = "Some of the items below are in folders set to be randomly ordered. However, when printing the contents of these folders, they will be printed in the original order for all students, not the randomized order."; + } + } + if ($message) { + return ''.$message.''; + } + } else { + &Apache::lonnet::logthis('Retrieval of resources to check for folders set to be randomly ordered failed - could not create navmap object'); + $message = "Retrieval of information about ordering of resources failed."; + return ''.$message.''; } return; } @@ -3448,16 +3453,12 @@ sub render { my $PaperType=&mt('Paper type'); my $landscape=&mt('Landscape'); my $portrait=&mt('Portrait'); - my $pdfFormLabel=&mt('PDF-Formfields'); - my $with=&mt('with Formfields'); - my $without=&mt('without Formfields'); $result.='

'.&mt('Layout Options').'

' .&Apache::loncommon::start_data_table() .&Apache::loncommon::start_data_table_header_row() .''.$PageLayout.'' .''.$NumberOfColumns.'' .''.$PaperType.'' - .''.$pdfFormLabel.'' .&Apache::loncommon::end_data_table_header_row() .&Apache::loncommon::start_data_table_row() .'' @@ -3498,12 +3499,6 @@ sub render { $result .= < - - - HTML $result.=&Apache::loncommon::end_data_table_row() .&Apache::loncommon::end_data_table(); @@ -3518,7 +3513,7 @@ sub postprocess { my $helper = Apache::lonhelper->getHelper(); $helper->{VARS}->{$var} = $env{"form.$var.layout"} . '|' . $env{"form.$var.cols"} . '|' . - $env{"form.$var.paper"} . '|' . $env{"form.$var.pdfFormFields"}; + $env{"form.$var.paper"}; return 1; }