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

raeburn raeburn at source.lon-capa.org
Sat Apr 15 21:33:04 EDT 2023


raeburn		Sun Apr 16 01:33:04 2023 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  - Printout generation via print icon in "Tools" on Course Contents page.
    For these two items available to privileged users:
    (a) Selected Resources from selected folder in course for selected people
    (b) Selected Resources from selected folder in course for CODEd assignments
    include resources that are *not* problems in table of selectable resources.
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.690 loncom/interface/lonprintout.pm:1.691
--- loncom/interface/lonprintout.pm:1.690	Sat Apr 15 21:50:34 2023
+++ loncom/interface/lonprintout.pm	Sun Apr 16 01:33:04 2023
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.690 2023/04/15 21:50:34 raeburn Exp $
+# $Id: lonprintout.pm,v 1.691 2023/04/16 01:33:04 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4821,12 +4821,47 @@
                          '<b>','</b>','<b>','</b>','<b>','</b>'),
                          'select_sequences_resources_for_anon','CHOOSE_SEQUENCE_ANON2']);
                 if ($escapedSequenceName) {
-                    &generate_common_choosers($r,$helper,$escapedSequenceName,$escapedSequenceName,$isProblem,$symbFilter,$start_new_option);
+                    my ($randomly_ordered_warning,$codechoice,$code_selection,$namechoice) =
+                        &generate_common_choosers($r,$helper,$escapedSequenceName,$escapedSequenceName,
+                                                  $isProblem,$symbFilter,$start_new_option);
+
+                    my $resource_selector .= <<RESOURCE_SELECTOR;
+  <state name="CHOOSE_STUDENTS2" title="Select Students and Resources">
+    <choices variable='student_sort'>
+      <choice computer='0'>Sort by section then student</choice>
+      <choice computer='1'>Sort by students across sections.</choice>
+    </choices>
+    <message><br /><hr /><br /></message>
+    <student multichoice='1' variable="STUDENTS" nextstate="SELECT_RESOURCES" coursepersonnel="1" />
+
+    </state>
+    <state name="SELECT_RESOURCES" title="Select Resources">
+    $randomly_ordered_warning
+    <nextstate>PRINT_FORMATTING</nextstate>
+    <message>(mark desired resources then click "next" button) <br /></message>
+    <resource variable="RESOURCES" multichoice="1" addstatus="1"
+              closeallpages="1" modallink="1">
+      <filterfunc>return $isNotMap;</filterfunc>
+      <mapurl>$map</mapurl>
+      <valuefunc>return $symbFilter;</valuefunc>
+      $start_new_option
+      </resource>
+    </state>
+RESOURCE_SELECTOR
+
+                    my $anon3 = &generate_code_selector($helper,
+                                                        'CHOOSE_ANON3',
+                                                        'SELECT_RESOURCES',
+                                                        $codechoice,
+                                                        $code_selection,
+                                                        $namechoice) . $resource_selector;
+
+                    &Apache::lonxml::xmlparse($r, 'helper',$anon3);
                 }
             }
         }
         if (($subdir eq '') && ($url eq '/adm/navmaps') && ($perm{'pfo'})) {
-           &Apache::lonxml::xmlparse($r, 'helper', <<CHOOSE_FROM_ANY_SEQUENCE);
+            &Apache::lonxml::xmlparse($r, 'helper', <<CHOOSE_FROM_ANY_SEQUENCE);
   <state name="CHOOSE_SEQUENCE" title="Select Sequence To Print From">
     <message>Select the sequence to print resources from:</message>
     <resource variable="SEQUENCE">
@@ -4860,7 +4895,7 @@
   <state name="CHOOSE_SEQUENCE_STUDENTS1" title="Select Sequence To Print From">
     <message>Select the sequence to print resources from:</message>
     <resource variable="SEQUENCE">
-      <nextstate>CHOOSE_STUDENTS</nextstate>
+      <nextstate>CHOOSE_STUDENTS2</nextstate>
       <filterfunc>return &Apache::lonprintout::printable_sequence(\$res);</filterfunc>
       <valuefunc>return $urlValue;</valuefunc>
       <choicefunc>return \$res->hasResource(\$res,sub { return !\$_[0]->is_sequence() },0,0);
@@ -4870,7 +4905,7 @@
   <state name="CHOOSE_SEQUENCE_ANON2" title="Select Sequence To Print From">
     <message>Select the sequence to print resources from:</message>
     <resource variable="SEQUENCE">
-      <nextstate>CHOOSE_ANON1</nextstate>
+      <nextstate>CHOOSE_ANON3</nextstate>
       <filterfunc>return &Apache::lonprintout::printable_sequence(\$res);</filterfunc>
       <valuefunc>return $urlValue;</valuefunc>
       <choicefunc>return \$res->hasResource(\$res,sub { return !\$_[0]->is_sequence() },0,0);




More information about the LON-CAPA-cvs mailing list