--- loncom/homework/bridgetask.pm 2005/05/31 21:11:56 1.36 +++ loncom/homework/bridgetask.pm 2005/08/09 07:34:51 1.38 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: bridgetask.pm,v 1.36 2005/05/31 21:11:56 albertel Exp $ +# $Id: bridgetask.pm,v 1.38 2005/08/09 07:34:51 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -36,6 +36,7 @@ use Apache::File(); use Apache::lonmenu; use Apache::lonlocal; use Apache::lonxml; +use Apache::slotrequest(); use Time::HiRes qw( gettimeofday tv_interval ); BEGIN { @@ -164,14 +165,29 @@ sub add_grading_button { } sub add_request_another_attempt_button { + my ($text)=@_; + if (!$text) { $text="Request another attempt"; } my $result; my $symb=&Apache::lonnet::symbread(); + my ($slot_name,$slot)=&Apache::slotrequest::check_for_reservation($symb); + my $action='get_reservation'; + if ($slot_name) { + $text="Change reservation."; + $action='change_reservation'; + my $description=&Apache::slotrequest::get_description($slot_name, + $slot); + $result.=(< Will be next available: $description

+STUFF + } + if ($env{'request.enc'}) { $symb=&Apache::lonenc::encrypted($symb); } $symb=&Apache::lonnet::escape($symb); $result.='
'. ''. + ''. ''. + &mt($text).'" />'. '
'; return $result; } @@ -208,6 +224,14 @@ sub start_Task { my $uri=$env{'request.uri'}; if ($env{'request.enc'}) { $uri=&Apache::lonenc::encrypted($uri); } $body_tag_start.=$uri.'">'.&add_grading_button().""; + my $symb=&Apache::lonnet::symbread(); + $body_tag_start.='
'. + ''. + ''. + ''. + '
'; + } } if ($target eq 'web' || ($target eq 'grade' && !$env{'form.webgrade'}) || $target eq 'answer' || @@ -238,6 +262,7 @@ sub start_Task { $msg.='

'.&mt('Unable to determine if this resource is open due to network problems. Please try again later.').'

'; } elsif ($status eq 'NOT_IN_A_SLOT') { $msg.='

'.&mt('You are not currently signed up to work at this time and/or place.').'

'; + $msg.=&add_request_another_attempt_button("Sign up for time to work."); } elsif ($status eq 'NEEDS_CHECKIN') { $msg.='

'.&mt('You need the Proctor to validate you.'). '

'.&proctor_validation_screen($slot);