--- loncom/homework/structuretags.pm 2012/04/04 10:48:30 1.502 +++ loncom/homework/structuretags.pm 2013/08/08 12:23:22 1.512.2.4 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.502 2012/04/04 10:48:30 foxr Exp $ +# $Id: structuretags.pm,v 1.512.2.4 2013/08/08 12:23:22 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -379,10 +379,10 @@ sub page_start { } elsif (!defined($found{'body'}) && $env{'request.state'} eq 'construct') { if ($target eq 'web' || $target eq 'edit') { - # Breadcrumbs for Construction Space + # Breadcrumbs for Authoring Space &Apache::lonhtmlcommon::clear_breadcrumbs(); &Apache::lonhtmlcommon::add_breadcrumb({ - 'text' => 'Construction Space', + 'text' => 'Authoring Space', 'href' => &Apache::loncommon::authorspace($env{'request.uri'}), }); # breadcrumbs (and tools) will be created @@ -453,7 +453,6 @@ sub page_start { } $form_tag_start.='>'."\n"; - my $symb=&Apache::lonnet::symbread(); if ($symb =~ /\S/) { $symb= &HTML::Entities::encode(&Apache::lonenc::check_encrypt($symb)); @@ -976,7 +975,7 @@ sub checkout_msg {
$lt{'warning'}
ENDCHECKOUT } @@ -990,19 +989,19 @@ sub firstaccess_msg { my $foldertitle=&Apache::lonnet::gettitle($map); &Apache::lonxml::debug("map is $map title is $foldertitle"); - $result .= "'.&mt('Once you click the "Show Resource" button below you have [_2] to complete all resources "[_1]".' + ,$foldertitle,$time)."
"; } elsif ($interval[1] eq 'course') { my $course = $env{'course.'.$env{'request.course.id'}.'.description'}; - $result .= "'.&mt('Once you click the "Show Resource" button below you have [_2] to complete all resources "[_1]".' + ,$course,$time)."
"; } else { my $title=&Apache::lonnet::gettitle($symb); - $result .= "'.&mt('Once you click the "Show Resource" button below you have [_2] to complete this resource "[_1]".' + ,$title,$time)."
"; } my $uri = &Apache::lonenc::check_encrypt($env{'request.uri'}); my $buttontext = &mt('Show Resource'); @@ -1010,7 +1009,7 @@ sub firstaccess_msg { $result .= (<'.&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.').'
'; } elsif (($status eq 'RESERVABLE') || ($status eq 'RESERVABLE_LATER') || ($status eq 'NOTRESERVABLE')) { - $msg.=''.&mt('Access requires reservation to work at specific time/place.').'
'; } elsif ($status ne 'NOT_YET_VIEWED') { - $msg.=''.&mt('Not open to be viewed').'
'; } if ($status eq 'CLOSED' || $status eq 'INVALID_ACCESS') { $msg.=&mt('The problem ').$accessmsg; @@ -1298,13 +1297,35 @@ sub start_problem { 'problem'); } } elsif ($target eq 'web') { - if ($status eq 'CAN_ANSWER' - && $slot_name ne '' - && $Apache::lonhomework::history{'resource.0.checkedin'} eq '') { - # unproctored slot access, self checkin - &Apache::bridgetask::check_in('problem',undef,undef, - $slot_name); - } + if ($status eq 'CAN_ANSWER') { + $resource_due = &Apache::lonhomework::due_date(0, $env{'request.symb'}); + if ($slot_name ne '') { + my $checked_in = + $Apache::lonhomework::history{'resource.0.checkedin'}; + if ($checked_in eq '') { + # unproctored slot access, self checkin + &Apache::bridgetask::check_in('problem',undef,undef, + $slot_name); + $checked_in = + $Apache::lonhomework::results{"resource.0.checkedin"}; + } + if ((ref($slot) eq 'HASH') && ($checked_in ne '')) { + if ($slot->{'starttime'} < time()) { + if (!$resource_due) { + $resource_due = $slot->{'endtime'}; + } elsif ($slot->{'endtime'} < $resource_due) { + $resource_due = $slot->{'endtime'}; + } + } + } + } + if ($resource_due) { + my $time_left = $resource_due - time(); + if ($resource_due && ($time_left > 0) && ($target eq 'web')) { + $result .= &Apache::lonhtmlcommon::set_due_date($resource_due); + } + } + } $result.="\n $form_tag_start \t". ''; # create a page header and exit @@ -1490,7 +1511,13 @@ sub end_problem { $result.=""; } if ($target eq 'web') { - $result.= &Apache::loncommon::end_page({'discussion' => 1}); + # + # Closing