--- loncom/homework/structuretags.pm 2012/04/18 11:49:50 1.505 +++ loncom/homework/structuretags.pm 2012/05/28 13:09:22 1.506 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.505 2012/04/18 11:49:50 goltermann Exp $ +# $Id: structuretags.pm,v 1.506 2012/05/28 13:09:22 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1162,7 +1162,20 @@ sub start_problem { my $accessmsg; my $name= &get_resource_name($parstack,$safeeval); - my ($result,$form_tag_start); + my ($result,$form_tag_start,$slot_name,$slot); + + if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || + $target eq 'tex') { + if ($env{'form.markaccess'}) { + my @interval=&Apache::lonnet::EXT("resource.0.interval"); + &Apache::lonnet::set_first_access($interval[1]); + } + + ($status,$accessmsg,$slot_name,$slot) = + &Apache::lonhomework::check_slot_access('0','problem'); + push (@Apache::inputtags::status,$status); + } + if ($target eq 'web' || $target eq 'webgrade' || $target eq 'tex' || $target eq 'edit') { ($result,$form_tag_start) = @@ -1175,20 +1188,14 @@ sub start_problem { if ($target eq 'analyze') { my $rndseed=&setup_rndseed($safeeval,$target); } if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || $target eq 'tex') { - if ($env{'form.markaccess'}) { - my @interval=&Apache::lonnet::EXT("resource.0.interval"); - &Apache::lonnet::set_first_access($interval[1]); - } - my $resource_due = &Apache::lonhomework::due_date(0, $env{'request.symb'}); - my $time_left = $resource_due - time(); - if ($resource_due && ($time_left > 0) && ($target eq 'web')) { - $result .= &Apache::lonhtmlcommon::set_due_date($resource_due); - } - - ($status,$accessmsg,my $slot_name,my $slot) = - &Apache::lonhomework::check_slot_access('0','problem'); - push (@Apache::inputtags::status,$status); + if ($status eq 'CAN_ANSWER') { + my $resource_due = &Apache::lonhomework::due_date(0, $env{'request.symb'}); + my $time_left = $resource_due - time(); + if ($resource_due && ($time_left > 0) && ($target eq 'web')) { + $result .= &Apache::lonhtmlcommon::set_due_date($resource_due); + } + } #handle rand seed in construction space my $rndseed=&setup_rndseed($safeeval,$target);