--- loncom/homework/bridgetask.pm 2010/09/27 20:59:41 1.254 +++ loncom/homework/bridgetask.pm 2010/12/31 02:40:14 1.257 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: bridgetask.pm,v 1.254 2010/09/27 20:59:41 raeburn Exp $ +# $Id: bridgetask.pm,v 1.257 2010/12/31 02:40:14 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') || @@ -545,23 +547,35 @@ sub done_screen { my $title=&Apache::lonnet::gettitle($env{'request.uri'}); my @files=split(',',$Apache::lonhomework::history{'resource.'.$version.'.0.bridgetask.portfiles'}); my (undef,undef,$domain,$user)= &Apache::lonnet::whichuser(); - my $files = '
".&mt('Submitted non-existent file [_1]',$file)."
\n"; - } else { - $file = ''.$file.''; - $msg .= "".&mt('Submitted file [_1]',$file)."
\n"; - } - $files .= '".&mt('Submitted non-existent file [_1]',$file)."
\n"; + } else { + $file = ''.$file.''; + $msg .= "".&mt('Submitted file [_1]',$file)."
\n"; + } + $files .= ''.&mt('Files submitted: [_1]',$files).'
' + .''.&mt('You are now done with this Bridge Task').'
' + .''.&mt('Change to a different course').'
'; + } else { + $msg = &mt("Submission status: no files currently submitted, when 'Done' was indicated."); + $shown = ''. + &mt('You did not submit any files. Please try again.').'
'. + ''.&mt('Back to Bridge Task').'
'.&mt('Message sent to instructor: [_1]', $comment_status).'
'; } + return "'.&mt('Files submitted: [_1]',$files).'
' - .''.&mt('You are now done with this Bridge Task').'
' - .''.&mt('Change to a different course').'
' -.$message_status -.$comment_status; - + .$shown + .$message_status + .$comment_status; } sub start_Task { @@ -619,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') { @@ -661,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: /) { @@ -706,7 +724,10 @@ sub start_Task { $msg.=''.&Apache::lonhtmlcommon::start_pick_box(). + $result.="\n".'