--- loncom/homework/lonhomework.pm 2019/02/19 15:38:36 1.344.2.8.4.3 +++ loncom/homework/lonhomework.pm 2017/09/13 19:07:44 1.344.2.9 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Homework handler # -# $Id: lonhomework.pm,v 1.344.2.8.4.3 2019/02/19 15:38:36 raeburn Exp $ +# $Id: lonhomework.pm,v 1.344.2.9 2017/09/13 19:07:44 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -260,7 +260,7 @@ sub check_slot_access { $num_usable_slots ++; if ($slot{'starttime'} < $now && $slot{'endtime'} > $now && - &Apache::loncommon::check_slotip_acc($slot{'ip'})) { + &Apache::loncommon::check_ip_acc($slot{'ip'})) { &Apache::lonxml::debug("$slot is good"); $slotstatus='NEEDS_CHECKIN'; $returned_slot=\%slot; @@ -1460,41 +1460,6 @@ sub update_construct_style { } } -# -# Sets interval for current user so time left will be zero, either for the entire folder -# containing the current resource, or just the resource, depending on value of first item -# in interval array retrieved from EXT("resource.0.interval"); -# -sub zero_timer { - my ($symb) = @_; - my ($hastimeleft,$first_access,$now); - my @interval=&Apache::lonnet::EXT("resource.0.interval"); - if (@interval > 1) { - if ($interval[1] eq 'course') { - return; - } else { - my $now = time; - my $first_access=&Apache::lonnet::get_first_access($interval[1],$symb); - if ($first_access > 0) { - if ($first_access+$interval[0] > $now) { - my $done_time = $now - $first_access; - my $snum = 1; - if ($interval[1] eq 'map') { - $snum = 2; - } - my $result = - &Apache::lonparmset::storeparm_by_symb_inner($symb,'0_interval', - $snum,$done_time, - 'date_interval', - $env{'user.name'}, - $env{'user.domain'}); - return $result; - } - } - } - } - return; -} sub handler { #my $t0 = [&gettimeofday()]; @@ -1551,12 +1516,6 @@ sub handler { &newproblem($request); } } else { - # Set the event timer to zero if the "done button" was clicked. The button is - # part of the LCdoneButton form created in lonmenu.pm - if ($symb && $env{'form.LC_interval_done'} eq 'true') { - &zero_timer($symb); - undef($env{'form.LC_interval_done'}); - } # just render the page normally outside of construction space &Apache::lonxml::debug("not construct"); &renderpage($request,$file);