--- loncom/interface/lonprintout.pm 2007/07/25 19:15:29 1.504
+++ loncom/interface/lonprintout.pm 2007/09/08 23:41:49 1.509
@@ -2,7 +2,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.504 2007/07/25 19:15:29 albertel Exp $
+# $Id: lonprintout.pm,v 1.509 2007/09/08 23:41:49 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2222,6 +2222,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 +2470,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 +2513,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 +2914,7 @@ CHOOSE_FROM_ANY_SEQUENCE
Apache::lonhelper::dropdown->new();
addMessage("