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

matthew lon-capa-cvs@mail.lon-capa.org
Fri, 26 Apr 2002 19:10:54 -0000


matthew		Fri Apr 26 15:10:54 2002 EDT

  Modified files:              
    /loncom/interface	londropadd.pm 
  Log:
  Added 'check all' and 'uncheck all' to drop screen.
  
  
Index: loncom/interface/londropadd.pm
diff -u loncom/interface/londropadd.pm:1.31 loncom/interface/londropadd.pm:1.32
--- loncom/interface/londropadd.pm:1.31	Fri Apr 26 14:59:00 2002
+++ loncom/interface/londropadd.pm	Fri Apr 26 15:10:54 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to drop and add students in courses 
 #
-# $Id: londropadd.pm,v 1.31 2002/04/26 18:59:00 matthew Exp $
+# $Id: londropadd.pm,v 1.32 2002/04/26 19:10:54 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -698,6 +698,20 @@
     my ($r,%currentlist)=@_;
     my $cid=$ENV{'request.course.id'};
     $r->print(<<'END');
+<script>
+function checkAll(field)
+{
+    for (i = 0; i < field.length; i++)
+        field[i].checked = true ;
+}
+
+function uncheckAll(field)
+{
+    for (i = 0; i < field.length; i++)
+        field[i].checked = false ;
+}
+</script>
+<p>
 <input type="hidden" name="phase" value="four">
 <table border=2>
 <tr><th>&nbsp;</th><th>username</th><th>domain</th>
@@ -732,7 +746,12 @@
         }
     }
     $r->print('</table><br>');
-    $r->print('<input type=submit value="Drop Students">');
+    $r->print(<<"END");
+</p><p>
+<input type="button" value="check all" onclick="javascript:checkAll(document.studentform.droplist)"> &nbsp;
+<input type="button" value="uncheck all" onclick="javascript:uncheckAll(document.studentform.droplist)"> 
+<p><input type=submit value="Drop Students"></p>
+END
 }
 
 # ================================================= Drop/Add from uploaded file