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

foxr lon-capa-cvs@mail.lon-capa.org
Thu, 02 Mar 2006 23:56:56 -0000


foxr		Thu Mar  2 18:56:56 2006 EDT

  Modified files:              
    /loncom/interface	lonhelper.pm lonprintout.pm 
  Log:
  Enh request 3809 - Move stuff around on the student selection page
  for the print helper.. put all the fancy choice stuff and sort order at top.
  
  
Index: loncom/interface/lonhelper.pm
diff -u loncom/interface/lonhelper.pm:1.130 loncom/interface/lonhelper.pm:1.131
--- loncom/interface/lonhelper.pm:1.130	Tue Jan 24 17:20:19 2006
+++ loncom/interface/lonhelper.pm	Thu Mar  2 18:56:55 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # .helper XML handler to implement the LON-CAPA helper
 #
-# $Id: lonhelper.pm,v 1.130 2006/01/24 22:20:19 albertel Exp $
+# $Id: lonhelper.pm,v 1.131 2006/03/02 23:56:55 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2374,6 +2374,8 @@
 </table>
 <br />
 BUTTONS
+    $result .= $buttons;   
+
     }
 
     if (defined $self->{ERROR_MSG}) {
@@ -2430,6 +2432,50 @@
         }
         return $classlist->{$a}->[$fullname] cmp $classlist->{$b}->[$fullname];
     } @keys;
+    #
+    #  now add the fancy section choice... first enumerate the sections:
+    if ($self->{'multichoice'}) {
+	my %sections;
+	for my $key (@keys) {
+	    my $section_name = $classlist->{$key}->[$section];
+	    if ($section_name ne "") {
+		$sections{$section_name} = 1;
+	    }
+	}
+	#  The variable $choice_widget will have the html to make the choice 
+	#  selector.
+	my $size=5;
+	if (scalar(keys(%sections)) < 5) {
+	    $size=scalar(keys(%sections));
+	}
+	my $choice_widget = '<select multiple name="chosensections" size="'.$size.'">'."\n";
+	foreach my $sec (sort {lc($a) cmp lc($b)} (keys(%sections))) {
+	    $choice_widget .= "<option name=\"$sec\">$sec</option>\n";
+	}
+	$choice_widget .= "<option>none</option></select>\n";
+
+	# Build a table without any borders to contain the section based
+	# selection:
+
+	my $section_selectors =<<SECTIONSELECT;
+<table border="0">
+  <tr valign="top">
+   <td>For Sections:</td><td>$choice_widget</td>
+   <td><label><input type="radio" name="personstate" value="Active" checked />
+               Current Students</label></td>
+   <td><label><input type="radio" name="personstate" value="All" />
+               All students</label></td>
+   <td><label><input type="radio" name="personstate" value="Expired" />
+               Expired Students</label></td>
+  </tr>
+  <tr>
+   <td><input type="button" value="Select" onclick="checksections(true);" /></td>
+   <td><input type="button" value="Unselect" onclick="checksections(false);" /></td></tr>
+</table>
+<br />
+SECTIONSELECT
+         $result .= $section_selectors;
+    }
 
     # username, fullname, section, type
     for (@keys) {
@@ -2486,51 +2532,8 @@
     }
 
     $result .= "</table>\n\n";
-    $result .= $buttons;   
-    #
-    #  now add the fancy section choice... first enumerate the sections:
-    if ($self->{'multichoice'}) {
-	my %sections;
-	for my $key (@keys) {
-	    my $section_name = $classlist->{$key}->[$section];
-	    if ($section_name ne "") {
-		$sections{$section_name} = 1;
-	    }
-	}
-	#  The variable $choice_widget will have the html to make the choice 
-	#  selector.
-	my $size=5;
-	if (scalar(keys(%sections)) < 5) {
-	    $size=scalar(keys(%sections));
-	}
-	my $choice_widget = '<select multiple name="chosensections" size="'.$size.'">'."\n";
-	foreach my $sec (sort {lc($a) cmp lc($b)} (keys(%sections))) {
-	    $choice_widget .= "<option name=\"$sec\">$sec</option>\n";
-	}
-	$choice_widget .= "<option>none</option></select>\n";
 
-	# Build a table without any borders to contain the section based
-	# selection:
 
-	my $section_selectors =<<SECTIONSELECT;
-<table border="0">
-  <tr valign="top">
-   <td>For Sections:</td><td>$choice_widget</td>
-   <td><label><input type="radio" name="personstate" value="Active" checked />
-               Current Students</label></td>
-   <td><label><input type="radio" name="personstate" value="All" />
-               All students</label></td>
-   <td><label><input type="radio" name="personstate" value="Expired" />
-               Expired Students</label></td>
-  </tr>
-  <tr>
-   <td><input type="button" value="Select" onclick="checksections(true);" /></td>
-   <td><input type="button" value="Unselect" onclick="checksections(false);" /></td></tr>
-</table>
-<br />
-SECTIONSELECT
-         $result .= $section_selectors;
-    }
     return $result;
 }
 
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.424 loncom/interface/lonprintout.pm:1.425
--- loncom/interface/lonprintout.pm:1.424	Wed Mar  1 06:20:37 2006
+++ loncom/interface/lonprintout.pm	Thu Mar  2 18:56:55 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.424 2006/03/01 11:20:37 foxr Exp $
+# $Id: lonprintout.pm,v 1.425 2006/03/02 23:56:55 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2210,12 +2210,12 @@
 
         &Apache::lonxml::xmlparse($r, 'helper', <<CHOOSE_STUDENTS);
   <state name="CHOOSE_STUDENTS" title="Select Students and Resources">
-      <student multichoice='1' variable="STUDENTS" nextstate="SELECT_PROBLEMS" coursepersonnel="1"/>
       <message><b>Select sort order</b> </message>
     <choices variable='student_sort'>
       <choice computer='0'>Sort by section then student</choice>
       <choice computer='1'>Sort by students across sections.</choice>
     </choices>
+      <student multichoice='1' variable="STUDENTS" nextstate="SELECT_PROBLEMS" coursepersonnel="1"/>
   </state>
     $resource_selector
 CHOOSE_STUDENTS