--- loncom/homework/bridgetask.pm 2006/05/25 19:55:10 1.156 +++ loncom/homework/bridgetask.pm 2006/05/30 12:45:36 1.158 @@ -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.158 2006/05/30 12:45:36 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -38,6 +38,9 @@ use Apache::lonlocal; use Apache::lonxml; use Apache::slotrequest(); use Time::HiRes qw( gettimeofday tv_interval ); +use lib '/home/httpd/lib/perl/'; +use LONCAPA; + BEGIN { &Apache::lonxml::register('Apache::bridgetask',('Task','IntroParagraph','Dimension','Question','Instance','InstanceText','Criteria','ClosingParagraph')); @@ -263,7 +266,7 @@ STUFF } if ($env{'request.enc'}) { $symb=&Apache::lonenc::encrypted($symb); } - $symb=&Apache::lonnet::escape($symb); + $symb=&escape($symb); $result.='
'. ''. ''. @@ -574,7 +577,7 @@ DONESCREEN &Apache::lonnet::gettitle($symb).' for '.$uname.' at '.$udom.''; $form_tag_start.= ''; + &escape($todo).'" />'; $Apache::bridgetask::queue_key=$todo; &Apache::structuretags::initialize_storage(); &Apache::lonhomework::showhash(%Apache::lonhomework::history); @@ -705,7 +708,7 @@ sub get_key_todo { my $who=&queue_key_locked($queue,$gradingkey); if ($who eq $me) { #already have the lock - $env{'form.gradingkey'}=&Apache::lonnet::escape($gradingkey); + $env{'form.gradingkey'}=&escape($gradingkey); return ($gradingkey); } @@ -730,7 +733,7 @@ sub get_key_todo { $env{'form.queue'}=$queue='gradingqueue'; } - my $gradingkey=&Apache::lonnet::unescape($env{'form.gradingkey'}); + my $gradingkey=&unescape($env{'form.gradingkey'}); if ($env{'form.queue'} eq 'none') { if (defined($env{'form.gradingkey'})) { @@ -1202,8 +1205,14 @@ sub get_limited_classlist { 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()]; @@ -1286,7 +1295,7 @@ sub show_queue { $slot_text = ''; } if ($with_selects) { - my $ekey=&Apache::lonnet::escape($key); + my $ekey=&escape($key); my ($action,$description,$status)=('select',&mt('Select')); if (exists($queue{"$key\0locked"})) { my $me=$env{'user.name'}.':'.$env{'user.domain'}; @@ -1341,7 +1350,7 @@ sub get_queue_counts { 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); @@ -1485,7 +1494,7 @@ sub pick_from_queue_data { sub find_mid_grade { my ($queue,$symb,$cdom,$cnum)=@_; - my $todo=&Apache::lonnet::unescape($env{'form.gradingkey'}); + my $todo=&unescape($env{'form.gradingkey'}); my $me=$env{'user.name'}.':'.$env{'user.domain'}; if ($todo) { my $who=&queue_key_locked($queue,$todo,$cdom,$cnum); @@ -1526,7 +1535,7 @@ sub get_queue_symb_status { $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 +1563,7 @@ sub get_from_queue { if ($todo) { return $todo; } my $attempts=0; - my $classlist=&Apache::loncoursedata::get_classlist(); + my $classlist=&get_limited_classlist(); while (1) { if ($attempts > 2) { @@ -1657,7 +1666,7 @@ sub select_user { } } my $todo = - &Apache::lonnet::escape(&encode_queue_key($symb,$udom,$uname)); + &escape(&encode_queue_key($symb,$udom,$uname)); if ($cannot_grade) { $result.=' '.$classlist->{$student}[&Apache::loncoursedata::CL_FULLNAME()]. '';