--- loncom/homework/structuretags.pm 2018/05/15 04:59:14 1.560 +++ loncom/homework/structuretags.pm 2018/10/19 22:04:07 1.561 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.560 2018/05/15 04:59:14 raeburn Exp $ +# $Id: structuretags.pm,v 1.561 2018/10/19 22:04:07 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1765,14 +1765,17 @@ sub start_problem { my $ipused; my $name= &get_resource_name($parstack,$safeeval); - my ($result,$form_tag_start,$slot_name,$slot,$probpartlist); + my ($result,$form_tag_start,$slot_name,$slot,$probpartlist,$firstaccres); 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"); my ($timelimit) = split(/_/,$interval[0]); - &Apache::lonnet::set_first_access($interval[1],$timelimit); + my $is_set = &Apache::lonnet::set_first_access($interval[1],$timelimit); + unless (($is_set eq 'ok') || ($is_set eq 'already_set')) { + $firstaccres = $is_set; + } } } @@ -1879,6 +1882,10 @@ sub start_problem { ( $status eq 'NEED_DIFFERENT_IP')) { my $bodytext=&Apache::lonxml::get_all_text("/problem",$parser, $style); + if (($status eq 'NOT_YET_VIEWED') && ($firstaccres)) { + $result .= '

'. + &mt('A problem occurred when trying to start the timer.').'

'; + } $result .= &access_status_msg('problem',$status,$symb,$target,$ipused,$accessmsg); } elsif ($status eq 'NEEDS_CHECKIN') { my $bodytext=&Apache::lonxml::get_all_text("/problem",$parser,