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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 21 Nov 2005 23:00:20 -0000


albertel		Mon Nov 21 18:00:20 2005 EDT

  Modified files:              
    /loncom/homework	bridgetask.pm 
  Log:
  - eliminate passing of $cid
  
  
Index: loncom/homework/bridgetask.pm
diff -u loncom/homework/bridgetask.pm:1.83 loncom/homework/bridgetask.pm:1.84
--- loncom/homework/bridgetask.pm:1.83	Mon Nov 21 17:42:22 2005
+++ loncom/homework/bridgetask.pm	Mon Nov 21 18:00:19 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: bridgetask.pm,v 1.83 2005/11/21 22:42:22 albertel Exp $
+# $Id: bridgetask.pm,v 1.84 2005/11/21 23:00:19 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -990,10 +990,10 @@
     return undef;
 }
 
+
 sub check_queue_for_key {
-    my ($cid,$queue,$todo)=@_;
-    my $cnum=$env{'course.'.$cid.'.num'};
-    my $cdom=$env{'course.'.$cid.'.domain'};
+    my ($cdom,$cnum,$queue,$todo)=@_;
+
     my %results=
 	&Apache::lonnet::get($queue,[$todo,"$todo\0locked"],$cdom,$cnum);
     
@@ -1319,7 +1319,9 @@
     foreach my $student (sort {lc($$fullname{$a}) cmp lc($$fullname{$b}) } keys %$fullname) {
 	my ($uname,$udom) = split(/:/,$student);
 	
-	my %status = &get_student_status($symb,$cid,$udom,$uname);
+	my $cnum=$env{'course.'.$cid.'.num'};
+	my $cdom=$env{'course.'.$cid.'.domain'};
+	my %status = &get_student_status($symb,$cdom,$cnum,$udom,$uname);
 	my $queue = 'none';
 	my $cannot_grade;
 	if ($status{'reviewqueue'} =~ /^(in_progress|enqueue)$/) {
@@ -1398,16 +1400,16 @@
 }
 
 sub get_student_status {
-    my ($symb,$cid,$udom,$uname)=@_;
+    my ($symb,$cdom,$cnum,$udom,$uname)=@_;
     my %record = &Apache::lonnet::restore($symb,$env{'request.course.id'},
 					  $udom,$uname);
     my %status;
     $status{'status'}=$record{'resource.status'};
     $status{'version'}=$record{'resource.version'};
     $status{'grader'}=$record{'resource.grader'};
-    $status{'reviewqueue'}=&check_queue_for_key($cid,'reviewqueue',
+    $status{'reviewqueue'}=&check_queue_for_key($cdom,$cnum,'reviewqueue',
 				       &encode_queue_key($symb,$udom,$uname));
-    $status{'gradingqueue'}=&check_queue_for_key($cid,'gradingqueue',
+    $status{'gradingqueue'}=&check_queue_for_key($cdom,$cnum,'gradingqueue',
 				       &encode_queue_key($symb,$udom,$uname));
     return %status;
 }