--- rat/lonpage.pm 2016/05/30 03:02:37 1.114 +++ rat/lonpage.pm 2016/07/18 19:29:24 1.117 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Page Handler # -# $Id: lonpage.pm,v 1.114 2016/05/30 03:02:37 raeburn Exp $ +# $Id: lonpage.pm,v 1.117 2016/07/18 19:29:24 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -479,7 +479,7 @@ ENDEXT $type = 'Task'; } my ($status,$accessmsg,$slot_name,$slot) = - &Apache::lonhomework::check_slot_access('0',$type,$symb,$pagesymb); + &Apache::lonhomework::check_slot_access('0',$type,$symb); undef(%Apache::lonhomework::history); my $probstatus = &Apache::lonnet::EXT("resource.0.problemstatus",$symb); if (($status eq 'CAN_ANSWER') || (($status eq 'CANNOT_ANSWER') && @@ -498,32 +498,25 @@ ENDEXT my @interval=&Apache::lonnet::EXT("resource.0.interval",$symb); if (@interval > 1) { my $first_access; - if ($first_access > 0) { - if ($interval[1] eq 'map') { - my $ignorecache; - if ($env{'form.'.$prefix.'markaccess'} eq 'yes') { - $ignorecache = 1; - } - $first_access=&Apache::lonnet::get_first_access($interval[1],undef,$pagesymb,$ignorecache); - if (($first_access) && (!$pagefirstaccess)) { - $pagefirstaccess = $first_access; - } - } else { - $first_access=&Apache::lonnet::get_first_access($interval[1],$symb); + if ($interval[1] eq 'map') { + my $ignorecache; + if ($env{'form.'.$prefix.'markaccess'} eq 'yes') { + $ignorecache = 1; } - if ($first_access > 0) { - my ($timelimit) = ($interval[0] =~ /^(\d+)/); - if ($timelimit) { - my $timeremains = $timelimit + $first_access - $now; - if ($timeremains > 0) { - $timerhastime = $timeremains; - } - } + $first_access=&Apache::lonnet::get_first_access($interval[1],undef,$pagesymb,$ignorecache); + if (($first_access) && (!$pagefirstaccess)) { + $pagefirstaccess = $first_access; } + } else { + $first_access=&Apache::lonnet::get_first_access($interval[1],$symb); + } + if ($first_access > 0) { my ($timelimit) = ($interval[0] =~ /^(\d+)/); - my $timeremains = $first_access+$timelimit - $now; - if ($timeremains > 0) { - $timerhastime = $timeremains; + if ($timelimit) { + my $timeremains = $timelimit + $first_access - $now; + if ($timeremains > 0) { + $timerhastime = $timeremains; + } } } } @@ -969,6 +962,7 @@ sub add_countdown_timer { $type = $donebuttonextras->{'type'}; } else { $donebuttontext = &mt('Done'); + $type = 'map'; } $donebutton = &Apache::lonmenu::done_button_js($type,'','',$proctor,$donebuttontext);