--- loncom/lonnet/perl/lonnet.pm 2016/04/21 00:36:17 1.1307 +++ loncom/lonnet/perl/lonnet.pm 2016/05/30 02:45:43 1.1308 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.1307 2016/04/21 00:36:17 raeburn Exp $ +# $Id: lonnet.pm,v 1.1308 2016/05/30 02:45:43 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -4646,9 +4646,10 @@ my %cachedtimes=(); my $cachedtime=''; sub load_all_first_access { - my ($uname,$udom)=@_; + my ($uname,$udom,$ignorecache)=@_; if (($cachedkey eq $uname.':'.$udom) && - (abs($cachedtime-time)<5) && (!$env{'form.markaccess'})) { + (abs($cachedtime-time)<5) && (!$env{'form.markaccess'}) && + (!$ignorecache)) { return; } $cachedtime=time; @@ -4657,7 +4658,7 @@ sub load_all_first_access { } sub get_first_access { - my ($type,$argsymb,$argmap)=@_; + my ($type,$argsymb,$argmap,$ignorecache)=@_; my ($symb,$courseid,$udom,$uname)=&whichuser(); if ($argsymb) { $symb=$argsymb; } my ($map,$id,$res)=&decode_symb($symb); @@ -4669,7 +4670,7 @@ sub get_first_access { } else { $res=$symb; } - &load_all_first_access($uname,$udom); + &load_all_first_access($uname,$udom,$ignorecache); return $cachedtimes{"$courseid\0$res"}; } @@ -7518,8 +7519,8 @@ sub get_commblock_resources { } } } - if ($interval[0] =~ /^\d+/) { - my ($timelimit) = split(/_/,$interval[0]); + if ($interval[0] =~ /^(\d+/)) { + my $timelimit = $1; my $first_access; if ($type eq 'resource') { $first_access=&get_first_access($interval[1],$item);