[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm

bowersj2 lon-capa-cvs@mail.lon-capa.org
Wed, 30 Apr 2003 16:29:07 -0000


bowersj2		Wed Apr 30 12:29:07 2003 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  For Alex: Give him symbs.
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.131 loncom/interface/lonprintout.pm:1.132
--- loncom/interface/lonprintout.pm:1.131	Tue Apr 22 15:54:39 2003
+++ loncom/interface/lonprintout.pm	Wed Apr 30 12:29:07 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.131 2003/04/22 19:54:39 bowersj2 Exp $
+# $Id: lonprintout.pm,v 1.132 2003/04/30 16:29:07 bowersj2 Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1378,6 +1378,7 @@
         my $isProblem = '$res->is_problem();';
         my $isProblemOrMap = '$res->is_problem() || $res->is_map()';
         my $isNotMap = '!$res->is_map();';
+        my $symb = '$res->symb();';
         my $helperFragment = <<HELPERFRAGMENT;
   <state name="CHOOSE_PROBLEMS" title="Select Problems">
     <message>Select problems to print:</message>
@@ -1386,6 +1387,7 @@
       <filterfunc>return $isProblemOrMap</filterfunc>
       <choicefunc>return $isProblem</choicefunc>
       <mapurl>$map</mapurl>
+      <valuefunc>return $symb</valuefunc>
       </resource>
     </state>
 
@@ -1395,6 +1397,7 @@
       <nextstate>FINAL</nextstate>
       <choicefunc>return $isNotMap;</choicefunc>
       <mapurl>$map</mapurl>
+      <valuefunc>return $symb</valuefunc>
       </resource>
     </state>
 HELPERFRAGMENT
@@ -1405,10 +1408,23 @@
     # If the user is priviledged, allow them to print all 
     # problems in the course, optionally for selected students
     if (($ENV{'request.role'}=~m/^cc\./ or $ENV{'request.role'}=~m/^in\./ or $ENV{'request.role'}=~m/^ta\./) and ($helper->{VARS}->{'postdata'}=~/\/res\//)) { 
-        push @{$printChoices}, ['<b>All problems</b> in course (may take a lot of time)', 'all_problems', 'FINAL'];
+        push @{$printChoices}, ['<b>All problems</b> in course (may take a lot of time)', 'all_problems', 'ALL_PROBLEMS'];
         push @{$printChoices}, ["Problems from <b>$sequenceTitle</b> for selected students", 'problems_for_students', 'CHOOSE_STUDENTS'];
 
+        my $isProblem = '$res->is_problem();';
+        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">
+    <message>Select problems to print:</message>
+    <resource variable="RESOURCES" multichoice="1">
+      <nextstate>FINAL</nextstate>
+      <filterfunc>return $isProblemOrMap</filterfunc>
+      <choicefunc>return $isProblem</choicefunc>
+      <valuefunc>return $symb</valuefunc>
+      </resource>
+    </state>
+
   <state name="CHOOSE_STUDENTS" title="Choose Students">
     <message>Select the students you wish to print the problems for:</message>
     <student multichoice='1' variable="STUDENTS" nextstate="FINAL" />