--- loncom/interface/lonprintout.pm 2010/09/15 16:37:36 1.585
+++ loncom/interface/lonprintout.pm 2011/03/11 05:01:36 1.586
@@ -2,7 +2,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.585 2010/09/15 16:37:36 raeburn Exp $
+# $Id: lonprintout.pm,v 1.586 2011/03/11 05:01:36 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -256,6 +256,37 @@ CHOOSE_ANON1
return $result;
}
+sub generate_format_selector {
+ my ($helper,$title,$nextstate) = @_;
+ my $secpdfoption;
+ unless (($helper->{'VARS'}->{'PRINT_TYPE'} eq 'problems_for_anon') ||
+ ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'problems_for_anon_page') ||
+ ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'resources_for_anon') ) {
+ $secpdfoption = 'Each PDF contains exactly one section';
+ }
+ return <
+ $nextstate
+
How should the results be printed?
+
+ Start each student\'s assignment on a new page/column (add a pagefeed after each assignment)
+ Add one empty page/column after each student\'s assignment
+ Add two empty pages/column after each student\'s assignment
+ Add three empty pages/column after each student\'s assignment
+
+ PAGESIZE
+
How do you want assignments split into PDF files?
+
+ All assignments in a single PDF file
+ $secpdfoption
+ Each PDF contains exactly one assignment
+
+ Specify the number of assignments per PDF:
+
+
+RESOURCE_SELECTOR
+}
+
#-----------------------------------------------------------------------
@@ -3578,27 +3609,15 @@ ALL_PROBLEMS
$map,
$isProblem, '', $symbFilter,
$start_new_option);
- $resource_selector .= <
-
How should the results be printed?
-
- Start each student\'s assignment on a new page/column (add a pagefeed after each assignment)
- Add one empty page/column after each student\'s assignment
- Add two empty pages/column after each student\'s assignment
- Add three empty pages/column after each student\'s assignment
-
- PAGESIZE
-
How do you want assignments split into PDF files?
-
- All assignments in a single PDF file
- Each PDF contains exactly one section
- Each PDF contains exactly one assignment
-
- Specify the number of assignments per PDF:
-
-
-RESOURCE_SELECTOR
- $resource_selector .= &generate_resource_chooser('CHOOSE_STUDENTS_PAGE',
+ my $secpdfoption;
+ unless (($helper->{'VARS'}->{'PRINT_TYPE'} eq 'problems_for_anon') ||
+ ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'problems_for_anon_page') ||
+ ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'resources_for_anon') ) {
+ $secpdfoption = 'Each PDF contains exactly one section';
+ }
+ $resource_selector .= &generate_format_selector($helper,
+ 'How should results be printed?').
+ &generate_resource_chooser('CHOOSE_STUDENTS_PAGE',
'Select Problem(s) to print',
"multichoice='1' addstatus='1' closeallpages ='1'",
'RESOURCES',
@@ -3726,28 +3745,12 @@ RESOURCE_SELECTOR
$start_new_option
-
-
- NUMBER_PER_PDF
-
How should the results be printed?
-
- Start each student\'s assignment on a new page/column (add a pagefeed after each assignment)
- Add one empty page/column after each student\'s assignment
- Add two empty pages/column after each student\'s assignment
- Add three empty pages/column after each student\'s assignment
-
- PAGESIZE
-
How do you want assignments split into PDF files?
-
- All assignments in a single PDF file
- Each PDF contains exactly one section
- Each PDF contains exactly one assignment
-
- Specify the number of assignments per PDF:
-
-
RESOURCE_SELECTOR
+ my $nextstate = 'NUMBER_PER_PDF';
+ $resource_selector .= &generate_format_selector($helper,
+ 'Format of the print job',
+ $nextstate);
&Apache::lonxml::xmlparse($r, 'helper', <