--- loncom/homework/lonhomework.pm 2024/12/09 22:22:57 1.387 +++ loncom/homework/lonhomework.pm 2024/12/13 05:04:49 1.389 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Homework handler # -# $Id: lonhomework.pm,v 1.387 2024/12/09 22:22:57 raeburn Exp $ +# $Id: lonhomework.pm,v 1.389 2024/12/13 05:04:49 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2008,6 +2008,7 @@ sub run_passback { my $uname = $item->{'uname'}; my $udom = $item->{'udom'}; my $uhome = $item->{'uhome'}; + my $usec = $item->{'usec'}; my $keynum = $item->{'lti'}->{'cipher'}; my $crsdef = $item->{'crsdef'}; my $scoretype = $item->{'format'}; @@ -2041,12 +2042,12 @@ sub run_passback { if (($pbscope eq 'map') || ($pbscope eq 'nonrec')) { if ((keys(%total_by_symb)) && (keys(%possible_by_symb))) { ($total,$possible) = - &get_lti_score($uname,$udom,$map,$pbscope,\%total_by_symb,\%possible_by_symb); + &get_lti_score($uname,$udom,$usec,$map,$pbscope,\%total_by_symb,\%possible_by_symb); } else { - ($total,$possible) = &get_lti_score($uname,$udom,$map,$pbscope); + ($total,$possible) = &get_lti_score($uname,$udom,$usec,$map,$pbscope); } } elsif ($pbscope eq 'course') { - ($total,$possible) = &get_lti_score($uname,$udom); + ($total,$possible) = &get_lti_score($uname,$udom,$usec); } $item->{'total'} = $total; $item->{'possible'} = $possible; @@ -2111,7 +2112,11 @@ sub run_passback { $no_passback .= " LTI launcher $linkprotector ($appname) for $linkuri (${cdom}_${cnum})"; &Apache::lonnet::logthis($no_passback." for $uname:$udom"); &Apache::lonnet::log($udom,$uname,$uhome,"$no_passback score=$score total=$total poss=$possible"); - &Apache::lonnet::put('linkprot_passback_pending',$item,$cdom,$cnum); + if ($item->{'linkprot'}) + my $pendingkey = &Time::HiRes::time().':'.$uname.':'.$udom.':'. + "$linkuri\0$linkprotector\0$scope"; + &Apache::lonnet::put('linkprot_passback_pending',{$pendingkey => $item},$cdom,$cnum); + } } } } @@ -2121,8 +2126,8 @@ sub run_passback { } sub get_lti_score { - my ($uname,$udom,$mapurl,$pbscope,$totals,$possibles) = @_; - my $navmap = Apache::lonnavmaps::navmap->new($uname,$udom); + my ($uname,$udom,$usec,$mapurl,$pbscope,$totals,$possibles) = @_; + my $navmap = Apache::lonnavmaps::navmap->new($uname,$udom,$usec); if (ref($navmap)) { my $iterator; if ($mapurl ne '') {