--- loncom/interface/lonprintout.pm 2007/07/25 20:39:57 1.505 +++ loncom/interface/lonprintout.pm 2007/10/11 22:49:49 1.510 @@ -2,7 +2,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.505 2007/07/25 20:39:57 albertel Exp $ +# $Id: lonprintout.pm,v 1.510 2007/10/11 22:49:49 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1969,10 +1969,7 @@ ENDPART } my $URLback=''; #link to original document - if ($helper->{'VARS'}->{'construction'} ne '1') { - #prints published resource - $URLback=&escape('/adm/flip?postdata=return:'); - } else { + if ($helper->{'VARS'}->{'construction'} eq '1') { #prints resource from the construction space $URLback='/'.$helper->{'VARS'}->{'filename'}; if ($URLback=~/([^?]+)/) { @@ -2222,6 +2219,28 @@ sub init_perm { } } +sub get_randomly_ordered_warning { + my ($helper,$map) = @_; + + my $message; + + 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.''; + } + return; +} + sub printHelper { my $r = shift; @@ -2448,8 +2467,8 @@ HELPERFRAGMENT if ($perm{'pfo'} && !$is_published && ($helper->{VARS}->{'postdata'}=~/\/res\// || $helper->{VARS}->{'postdata'}=~/\/(syllabus|smppg|aboutme|bulletinboard)$/)) { - push @{$printChoices}, ['Selected Problems from entire course', 'all_problems', 'ALL_PROBLEMS']; - push @{$printChoices}, ['Selected Resources from entire course', 'all_resources', 'ALL_RESOURCES']; + push @{$printChoices}, [&mtn('Selected Problems from entire course'), 'all_problems', 'ALL_PROBLEMS']; + push @{$printChoices}, [&mtn('Selected Resources from entire course'), 'all_resources', 'ALL_RESOURCES']; &Apache::lonxml::xmlparse($r, 'helper', < Problems from folder [_1] for CODEd assignments",$sequenceTitle), 'problems_for_anon', 'CHOOSE_ANON1']; } + my $randomly_ordered_warning = + &get_randomly_ordered_warning($helper,$map); + # resource_selector will hold a few states that: # - Allow resources to be selected for printing. # - Determine pagination between assignments. @@ -2488,6 +2510,8 @@ ALL_PROBLEMS # my $resource_selector=< + $randomly_ordered_warning + PRINT_FORMATTING
Select resources for the assignment
+ $randomly_ordered_warning + PRINT_FORMATTING
Select resources for the assignment
{VARS}->{'construction'} && !$is_published) { - push @$printChoices, ["Selected Resources from selected folder in course", + push @$printChoices, [&mtn("Selected Resources from selected folder in course"), 'select_sequences', 'CHOOSE_SEQUENCE']; my $escapedSequenceName = $helper->{VARS}->{'SEQUENCE'}; #Escape apostrophes and backslashes for Perl @@ -2885,7 +2911,7 @@ CHOOSE_FROM_ANY_SEQUENCE Apache::lonhelper::dropdown->new(); addMessage("". - ''. + ': "); $paramHash = Apache::lonhelper::getParamHash(); @@ -2937,6 +2963,7 @@ CHOOSE_FROM_ANY_SEQUENCE my $stylevalue='$Apache::lonnet::env{"construct.style"}'; my $randseedtext=&mt("Use random seed"); my $stylefiletext=&mt("Use style file"); + my $selectfiletext=&mt("Select style file"); my $xmlfrag .= <<"RNDSEED"; @@ -2954,9 +2981,9 @@ CHOOSE_FROM_ANY_SEQUENCE return $stylevalue; -   Select style file +   $selectfiletext - Show all foils? + Show all foils RNDSEED @@ -3065,6 +3092,8 @@ sub render { my $PageLayout=&mt('Page layout'); my $NumberOfColumns=&mt('Number of columns'); my $PaperType=&mt('Paper type'); + my $landscape=&mt('Landscape'); + my $portrait=&mt('Portrait'); $result .= < @@ -3076,8 +3105,8 @@ sub render { -
- +
+