--- loncom/homework/bridgetask.pm 2010/10/12 16:07:43 1.255 +++ loncom/homework/bridgetask.pm 2010/11/01 16:32:32 1.256 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: bridgetask.pm,v 1.255 2010/10/12 16:07:43 raeburn Exp $ +# $Id: bridgetask.pm,v 1.256 2010/11/01 16:32:32 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -37,6 +37,7 @@ use Apache::lonmenu; use Apache::lonlocal; use Apache::lonxml; use Apache::slotrequest(); +use Apache::structuretags(); use Time::HiRes qw( gettimeofday tv_interval ); use LONCAPA; @@ -380,6 +381,7 @@ sub show_task { ( $status eq 'BANNED') || ( $status eq 'UNAVAILABLE') || ( $status eq 'NOT_IN_A_SLOT') || + ( $status eq 'NOT_YET_VIEWED') || ( $status eq 'NEEDS_CHECKIN') || ( $status eq 'WAITING_FOR_GRADE') || ( $status eq 'INVALID_ACCESS') || @@ -627,6 +629,14 @@ sub start_Task { &Apache::structuretags::page_start($target,$token,$tagstack, $parstack,$parser,$safeeval, $name,&style($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]); + } } if ($target eq 'web' && $env{'request.state'} ne 'construct') { @@ -669,8 +679,8 @@ sub start_Task { my ($version,$previous)=&get_version(); ($status,$accessmsg,my $slot_name,$slot) = &Apache::lonhomework::check_slot_access('0','Task'); - if ($status eq 'CAN_ANSWER' && $version eq '') { - # CAN_ANSWER mode, and no current version, unproctored access + if ((($status eq 'CAN_ANSWER') || ($status eq 'NOT_YET_VIEWED')) && ($version eq '')) { + # CAN_ANSWER or NOT_YET_VIEWED mode, and no current version, unproctored access # thus self-checkedin my $check = &check_in('Task',undef,undef,$slot_name); if ($check =~ /^error: /) { @@ -714,7 +724,10 @@ sub start_Task { $msg.='