--- loncom/homework/bridgetask.pm 2006/05/12 04:32:58 1.148 +++ loncom/homework/bridgetask.pm 2006/05/12 05:18:34 1.149 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: bridgetask.pm,v 1.148 2006/05/12 04:32:58 albertel Exp $ +# $Id: bridgetask.pm,v 1.149 2006/05/12 05:18:34 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -223,6 +223,12 @@ sub add_request_another_attempt_button { if (!$text) { $text="Request another attempt"; } my $result; my $symb=&Apache::lonnet::symbread(); + # not a slot access based resource + my $useslots = &Apache::lonnet::EXT("resource.0.useslots",$symb); + if ($useslots =~ /^\s*no\s*$/i) { + return ''; + } + my ($slot_name,$slot)=&Apache::slotrequest::check_for_reservation($symb); my $action='get_reservation'; if ($slot_name) { @@ -807,11 +813,19 @@ DONEBUTTON my $bt_status=$Apache::lonhomework::history{"resource.$version.0.status"}; my $title=&Apache::lonnet::gettitle(); + my $start_time; + my $slot_name= $Apache::lonhomework::history{"resource.$version.0.checkedin.slot"}; - my %slot=&Apache::lonnet::get_slot($slot_name); - my $start_time= - &Apache::lonlocal::locallocaltime($slot{'starttime'}); + if ($slot_name) { + my %slot=&Apache::lonnet::get_slot($slot_name); + + $start_time=$slot{'starttime'} + } else { + $start_time= + &Apache::lonnet::EXT('resource.0.opendate'); + } + $start_time=&Apache::lonlocal::locallocaltime($start_time); my $status = "\n
\n"; @@ -848,8 +862,6 @@ DONEBUTTON my $internal_location=&internal_location(); $result=~s/\Q$internal_location\E/$status/; } - } - if ($target eq 'web') { $result.="\n
\n". &Apache::loncommon::end_page({'discussion' => 1}); }