--- loncom/lonnet/perl/lonnet.pm 2018/09/21 03:38:44 1.1385 +++ loncom/lonnet/perl/lonnet.pm 2018/10/19 16:54:58 1.1386 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.1385 2018/09/21 03:38:44 raeburn Exp $ +# $Id: lonnet.pm,v 1.1386 2018/10/19 16:54:58 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -5241,7 +5241,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); @@ -5257,6 +5262,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; }