--- loncom/lonnet/perl/lonnet.pm 2018/09/22 03:11:40 1.1172.2.101 +++ loncom/lonnet/perl/lonnet.pm 2018/11/01 18:57:29 1.1172.2.102 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.1172.2.101 2018/09/22 03:11:40 raeburn Exp $ +# $Id: lonnet.pm,v 1.1172.2.102 2018/11/01 18:57:29 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -4893,7 +4893,12 @@ sub set_first_access { } $cachedkey=''; my $firstaccess=&get_first_access($type,$symb,$map); - if (!$firstaccess) { + if ($firstaccess) { + &logthis("First access time already set ($firstaccess) when attempting ". + "to set new value (type: $type, extent: $res) for $uname:$udom ". + "in $courseid"); + return 'already_set'; + } else { my $start = time; my $putres = &put('firstaccesstimes',{"$courseid\0$res"=>$start}, $udom,$uname); @@ -4909,6 +4914,9 @@ sub set_first_access { if (($cachedtime) && (abs($start-$cachedtime) < 5)) { $cachedtimes{"$courseid\0$res"} = $start; } + } elsif ($putres ne 'refused') { + &logthis("Result: $putres when attempting to set first access time ". + "(type: $type, extent: $res) for $uname:$udom in $courseid"); } return $putres; }