--- loncom/homework/bridgetask.pm 2006/01/21 01:46:14 1.95 +++ loncom/homework/bridgetask.pm 2006/01/21 08:27:09 1.97 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: bridgetask.pm,v 1.95 2006/01/21 01:46:14 albertel Exp $ +# $Id: bridgetask.pm,v 1.97 2006/01/21 08:27:09 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1180,6 +1180,7 @@ sub get_queue_counts { return (0,0,0); } my ($entries,$ready_to_grade,$locks)=(0,0,0); + my %slot_cache; foreach my $key (sort(keys(%queue))) { if ($key=~/locked$/) { $locks++; @@ -1189,8 +1190,11 @@ sub get_queue_counts { my ($symb,$uname,$udom) = &decode_queue_key($key); $entries++; my $slot=$queue{$key}->[0]; - my %slot_data=&Apache::lonnet::get_slot($slot); - if (time > $slot_data{'endtime'}) { + if (!exists($slot_cache{$slot})) { + my %slot_data=&Apache::lonnet::get_slot($slot); + $slot_cache{$slot} = \%slot_data; + } + if (time > $slot_cache{$slot}{'endtime'}) { $ready_to_grade++; } } @@ -1330,7 +1334,9 @@ sub get_from_queue { $cdom,$cnum); &Apache::lonxml::debug("$starttime"); my $regexp="^$symb\0queue\0"; - my %queue=&Apache::lonnet::dump($queue,$cdom,$cnum,$regexp); + my $range= ($attempts < 1 ) ? '0-100' : '0-400'; + + my %queue=&Apache::lonnet::dump($queue,$cdom,$cnum,$regexp,$range); #make a pass looking for a user _not_ in my section if ($env{'request.course.sec'}) { &Apache::lonxml::debug("sce");