--- loncom/interface/lonprintout.pm	2003/04/30 16:29:07	1.132
+++ loncom/interface/lonprintout.pm	2003/05/01 15:01:04	1.138
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.132 2003/04/30 16:29:07 bowersj2 Exp $
+# $Id: lonprintout.pm,v 1.138 2003/05/01 15:01:04 bowersj2 Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1415,7 +1415,7 @@ HELPERFRAGMENT
         my $isProblemOrMap = '$res->is_problem() || $res->is_map()';
         my $symb = '$res->symb();';
         &Apache::lonxml::xmlparse($r, 'helper', <<CHOOSE_STUDENTS);
-  <state name="All_PROBLEMS" title="Select Problems">
+  <state name="ALL_PROBLEMS" title="Select Problems">
     <message>Select problems to print:</message>
     <resource variable="RESOURCES" multichoice="1">
       <nextstate>FINAL</nextstate>
@@ -1440,12 +1440,13 @@ CHOOSE_STUDENTS
         &Apache::lonxml::xmlparse($r, 'helper', <<CHOOSE_FROM_SUBDIR);
   <state name="CHOOSE_FROM_SUBDIR" title="Select Files">
     <message>Select problems you wish to print from <b>$subdir</b></message>
-    <files variable="FILES">
+    <files variable="FILES" multichoice='1'>
       <nextstate>FINAL</nextstate>
-      <filechoice>$subdir</filechoice>
+      <filechoice>return '$subdir';</filechoice>
       <filefilter>return $f =~ 
-           m/^[^\.]+\.(problem|exam|quiz|assess|survey|form|library)$/;
+           m/^[^\\.]+\\.(problem|exam|quiz|assess|survey|form|library)$/;
       </filefilter>
+      </files>
     </state>
 CHOOSE_FROM_SUBDIR
     }
@@ -1457,6 +1458,7 @@ CHOOSE_FROM_SUBDIR
     Apache::lonhelper::message->new();
     $paramHash = Apache::lonhelper::getParamHash();
     $paramHash->{'variable'} = 'PRINT_TYPE';
+    $helper->declareVar('PRINT_TYPE');
     $paramHash->{CHOICES} = $printChoices;
     Apache::lonhelper::choices->new();
     Apache::lonprintout::page_format_state->new("FORMAT");
@@ -1524,7 +1526,11 @@ my @paperSize = ("Letter [8 1/2x11 in]",
 sub new { 
     my $self = Apache::lonhelper::element->new();
 
+    shift;
+
     $self->{'variable'} = shift;
+    my $helper = Apache::lonhelper::getHelper();
+    $helper->declareVar($self->{'variable'});
     bless($self);
     return $self;
 }
@@ -1582,6 +1588,17 @@ STATEHTML
     return $result;
 }
 
+sub postprocess {
+    my $self = shift;
+
+    my $var = $self->{'variable'};
+    my $helper = Apache::lonhelper->getHelper();
+    $helper->{VARS}->{$var} = 
+        $ENV{"form.$var.layout"} . '|' . $ENV{"form.$var.cols"} . '|' .
+        $ENV{"form.$var.paper"};
+    return 1;
+}
+
 1;
 
 __END__