[LON-CAPA-cvs] cvs: loncom /homework bridgetask.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 25 May 2006 20:08:18 -0000


albertel		Thu May 25 16:08:18 2006 EDT

  Modified files:              
    /loncom/homework	bridgetask.pm 
  Log:
  - only do active users
  
  
Index: loncom/homework/bridgetask.pm
diff -u loncom/homework/bridgetask.pm:1.156 loncom/homework/bridgetask.pm:1.157
--- loncom/homework/bridgetask.pm:1.156	Thu May 25 15:55:10 2006
+++ loncom/homework/bridgetask.pm	Thu May 25 16:08:18 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: bridgetask.pm,v 1.156 2006/05/25 19:55:10 albertel Exp $
+# $Id: bridgetask.pm,v 1.157 2006/05/25 20:08:18 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1202,8 +1202,14 @@
     my ($sections) = @_;
 
     my $classlist = &Apache::loncoursedata::get_classlist();
+    foreach my $student (keys(%$classlist)) {
+	if ( $classlist->{$student}[&Apache::loncoursedata::CL_STATUS()]
+	     ne 'Active') {
+	    delete($classlist->{$student});
+       	}
+    }
 
-    if (!grep('all',@{ $sections })) {
+    if (ref($sections) && !grep('all',@{ $sections })) {
 	foreach my $student (keys(%$classlist)) {
 	    my $section  = 
 		$classlist->{$student}[&Apache::loncoursedata::CL_SECTION()];
@@ -1341,7 +1347,7 @@
     my $cnum=$env{'course.'.$cid.'.num'};
     my $cdom=$env{'course.'.$cid.'.domain'};
 
-    my $classlist=&Apache::loncoursedata::get_classlist();
+    my $classlist=&get_limited_classlist();
 
     my $regexp="^$symb\0";
     my %queue=&Apache::lonnet::dump($queue,$cdom,$cnum,$regexp);
@@ -1526,7 +1532,7 @@
 	$cnum=$env{'course.'.$cid.'.num'};
 	$cdom=$env{'course.'.$cid.'.domain'};
     }
-    my $classlist=&Apache::loncoursedata::get_classlist();
+    my $classlist=&get_limited_classlist();
 
     my $regexp="^$symb\0";
     my %queue=&Apache::lonnet::dump($queue,$cdom,$cnum,$regexp);
@@ -1554,7 +1560,7 @@
     if ($todo) { return $todo; }
     my $attempts=0;
 
-    my $classlist=&Apache::loncoursedata::get_classlist();
+    my $classlist=&get_limited_classlist();
 
     while (1) {
 	if ($attempts > 2) {