--- loncom/homework/grades.pm 2023/03/10 23:36:22 1.596.2.12.2.60.2.3 +++ loncom/homework/grades.pm 2024/07/03 13:12:44 1.596.2.12.2.62 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.596.2.12.2.60.2.3 2023/03/10 23:36:22 raeburn Exp $ +# $Id: grades.pm,v 1.596.2.12.2.62 2024/07/03 13:12:44 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2523,7 +2523,8 @@ sub submission { # (3) All transactions (by date) # (4) The whole record (with detailed information for all transactions) - my ($string,$timestamp,$lastgradetime,$lastsubmittime) = &get_last_submission(\%record); + my ($string,$timestamp,$lastgradetime,$lastsubmittime) = + &get_last_submission(\%record); my $lastsubonly; @@ -2895,7 +2896,7 @@ sub get_last_submission { $prevsolved{$1} = $solved{$1}; $solved{$1} = $lasthash{$key}; } - } + } foreach my $partid (keys(%handgraded)) { if (($prevsolved{$partid} eq 'ungraded_attempted') && (($solved{$partid} eq 'incorrect_by_override') || @@ -2906,9 +2907,14 @@ sub get_last_submission { $prevsolved{$partid} = $solved{$partid}; } } - $timestamp = - &Apache::lonlocal::locallocaltime($$returnhash{$version.':timestamp'}); } +# +# Timestamp is for last transaction for this resource, which does not +# necessarily correspond to the time of last submission for problem (or part). +# + if ($lasthash{'timestamp'} ne '') { + $timestamp = &Apache::lonlocal::locallocaltime($lasthash{'timestamp'}); + } my (%typeparts,%randombytry); my $showsurv = &Apache::lonnet::allowed('vas',$env{'request.course.id'}); @@ -3800,8 +3806,8 @@ sub version_portfiles { $$record{$key} = join(',',@versioned_portfiles); push(@returned_keys,$key); } - } - return (@returned_keys); + } + return (@returned_keys); } sub get_next_version {