[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm
foxr
lon-capa-cvs@mail.lon-capa.org
Mon, 31 Jan 2005 12:03:09 -0000
foxr Mon Jan 31 07:03:09 2005 EDT
Modified files:
/loncom/interface lonprintout.pm
Log:
Defect 3782 - First crack.. needs a bit more thinking to be sure that it
works correctly for all things.. however at least the server does not
crash when asking for all resources in the course and it does seem to
kick out a promising set of results, however there may be problems with problems.
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.353 loncom/interface/lonprintout.pm:1.354
--- loncom/interface/lonprintout.pm:1.353 Mon Jan 24 07:17:55 2005
+++ loncom/interface/lonprintout.pm Mon Jan 31 07:03:08 2005
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.353 2005/01/24 12:17:55 foxr Exp $
+# $Id: lonprintout.pm,v 1.354 2005/01/31 12:03:08 foxr Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -991,9 +991,10 @@
} else {
$result.=&unsupported($currentURL,$helper->{'VARS'}->{'LATEX_TYPE'});
}
- } elsif (($helper->{'VARS'}->{'PRINT_TYPE'} eq 'map_problems') or
+ } elsif (($helper->{'VARS'}->{'PRINT_TYPE'} eq 'map_problems') or
($helper->{'VARS'}->{'PRINT_TYPE'} eq 'map_problems_pages') or
- ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'all_problems') or
+ ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'all_problems') or
+ ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'all_resources') or # BUGBUG
($helper->{'VARS'}->{'PRINT_TYPE'} eq 'select_sequences')) {
#-- produce an output string
if ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'map_problems') {
@@ -1002,6 +1003,8 @@
$selectionmade = 3;
} elsif ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'all_problems') {
$selectionmade = 4;
+ } elsif ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'all_resources') { #BUGBUG
+ $selectionmade = 4;
} elsif ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'select_sequences') {
$selectionmade = 7;
}
@@ -1767,12 +1770,13 @@
&Apache::lonxml::xmlparse($r, 'helper', $helperFragment);
}
- # If the user is priviledged, allow them to print all
- # problems in the course, optionally for selected students
+ # If the user is privileged, allow them to print all
+ # problems and resources in the entier course, optionally for selected students
if ($userPriviledged &&
($helper->{VARS}->{'postdata'}=~/\/res\// || $helper->{VARS}->{'postdata'}=~/\/(syllabus|smppg|aboutme|bulletinboard)$/)) {
push @{$printChoices}, ['<b>Problems</b> from <b>entire course</b>', 'all_problems', 'ALL_PROBLEMS'];
+ push @{$printChoices}, ['<b>Resources</b> from <b>entire course</b>', 'all_resources', 'ALL_RESOURCES'];
&Apache::lonxml::xmlparse($r, 'helper', <<ALL_PROBLEMS);
<state name="ALL_PROBLEMS" title="Select Problem(s) to print">
<message>(mark them then click "next" button) <br /></message>
@@ -1785,6 +1789,17 @@
<option text='Newpage' variable='FINISHPAGE' />
</resource>
</state>
+ <state name="ALL_RESOURCES" title="Select Resource(s) to print">
+ <message>(Mark them then click "next" button) <br /> </message>
+ <resource variable="RESOURCES" toponly='0' multichoice='1'
+ suppressEmptySequences='0' addstatus='1' closeallpages='1'>
+ <nextstate>PAGESIZE</nextstate>
+ <filterfunc>return $isNotMap; </filterfunc>
+ <mapurl> $map</mapursl>
+ <valuefunc>return $symbFilter;</valuefunc>
+ <option text='NewPage' variable='FINISHPAGE' />
+ </resource>
+ </state>
ALL_PROBLEMS
if ($helper->{VARS}->{'assignment'}) {