--- loncom/homework/structuretags.pm 2018/09/14 23:09:43 1.512.2.15 +++ loncom/homework/structuretags.pm 2018/11/01 19:39:28 1.512.2.16 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.512.2.15 2018/09/14 23:09:43 raeburn Exp $ +# $Id: structuretags.pm,v 1.512.2.16 2018/11/01 19:39:28 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1526,13 +1526,16 @@ sub start_problem { my $resource_due; 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"); - &Apache::lonnet::set_first_access($interval[1],$interval[0]); + my $is_set = &Apache::lonnet::set_first_access($interval[1],$interval[0]); + unless (($is_set eq 'ok') || ($is_set eq 'already_set')) { + $firstaccres = $is_set; + } } ($status,$accessmsg,$slot_name,$slot) = @@ -1646,6 +1649,10 @@ sub start_problem { } elsif ($status eq 'UNCHECKEDOUT') { $msg.=&checkout_msg(); } elsif ($status eq 'NOT_YET_VIEWED') { + if ($firstaccres) { + $msg .= '

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

'; + } $msg.=&firstaccess_msg($accessmsg,$symb); } elsif ($status eq 'NOT_IN_A_SLOT') { $msg.=&Apache::bridgetask::add_request_another_attempt_button("Sign up for time to work");