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

sakharuk lon-capa-cvs@mail.lon-capa.org
Thu, 09 Oct 2003 14:28:09 -0000


sakharuk		Thu Oct  9 10:28:09 2003 EDT

  Modified files:              
    /loncom/interface	lonhelper.pm 
  Log:
   Bug 2227 (Select which student to print needs to be easier) is fixed. You can select only "active" students or you can select by sections.
  
  
Index: loncom/interface/lonhelper.pm
diff -u loncom/interface/lonhelper.pm:1.52 loncom/interface/lonhelper.pm:1.53
--- loncom/interface/lonhelper.pm:1.52	Wed Oct  8 14:23:26 2003
+++ loncom/interface/lonhelper.pm	Thu Oct  9 10:28:09 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # .helper XML handler to implement the LON-CAPA helper
 #
-# $Id: lonhelper.pm,v 1.52 2003/10/08 18:23:26 bowersj2 Exp $
+# $Id: lonhelper.pm,v 1.53 2003/10/09 14:28:09 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2081,12 +2081,30 @@
             }
         }
     }
+    function checksec() {
+	for (i=0; i<document.forms.helpform.elements.length; i++) {
+	    comp = document.forms.helpform.elements.chksec.value;
+            if (document.forms.helpform.elements[i].value.indexOf(':'+comp+':') != -1) {
+                document.forms.helpform.elements[i].checked=true;
+            }
+        }
+    }
+    function checkactive() {
+	for (i=0; i<document.forms.helpform.elements.length; i++) {
+            if (document.forms.helpform.elements[i].value.indexOf(':Active') != -1) {
+                document.forms.helpform.elements[i].checked=true;
+            }
+        }
+    }
 </script>
 SCRIPT
         $buttons = <<BUTTONS;
 <br />
+<input type="button" onclick="checkactive()" value="Select Only Current Students" />
 <input type="button" onclick="checkall(true, '$var')" value="Select All Students" />
 <input type="button" onclick="checkall(false, '$var')" value="Unselect All Students" />
+<input type="button" onclick="checksec()" value="Check for Section/Group">
+<input type="text" size="5" name="chksec">&nbsp;
 <br />
 BUTTONS
     }
@@ -2140,7 +2158,8 @@
 	if (!$self->{'activeonly'} || $classlist->{$_}->[$status] eq
 	    'Active') {
 	    push @$choices, [$_, $classlist->{$_}->[$fullname], 
-			     $classlist->{$_}->[$section], 'Student'];
+			     $classlist->{$_}->[$section],
+			     $classlist->{$_}->[$status], 'Student'];
 	}
     }
 
@@ -2150,7 +2169,9 @@
     $result .= "<table cellspacing='2' cellpadding='2' border='0'>\n";
     $result .= "<tr><td></td><td align='center'><b>$name</b></td>".
         "<td align='center'><b>Section</b></td>" . 
-	"<td align='center'><b>Role</b></td></tr>";
+	"<td align='center'><b>Status</b></td>" . 
+	"<td align='center'><b>Role</b></td>" .
+	"<td align='center'><b>Username:Domain</b></td></tr>";
 
     my $checked = 0;
     for my $choice (@$choices) {
@@ -2162,13 +2183,18 @@
             $checked = 1;
         }
         $result .=
-            " value='" . HTML::Entities::encode($choice->[0] . ':' . $choice->[2])
+            " value='" . HTML::Entities::encode($choice->[0] . ':' . $choice->[2] . ':' . $choice->[1] . ':' . $choice->[3])
             . "' /></td><td>"
             . HTML::Entities::encode($choice->[1])
             . "</td><td align='center'>" 
             . HTML::Entities::encode($choice->[2])
             . "</td>\n<td>" 
-	    . HTML::Entities::encode($choice->[3]) . "</td></tr>\n";
+	    . HTML::Entities::encode($choice->[3])
+            . "</td>\n<td>" 
+	    . HTML::Entities::encode($choice->[4])
+            . "</td>\n<td>" 
+	    . HTML::Entities::encode($choice->[0])
+	    . "</td></tr>\n";
     }
 
     $result .= "</table>\n\n";