version 1.387, 2024/12/09 22:22:57
|
version 1.393, 2025/01/05 22:42:44
|
Line 1989 sub do_ltipassback {
|
Line 1989 sub do_ltipassback {
|
} |
} |
undef(@Apache::lonhomework::ltipassback); |
undef(@Apache::lonhomework::ltipassback); |
} |
} |
|
return OK; |
} |
} |
|
|
sub run_passback { |
sub run_passback { |
Line 2008 sub run_passback {
|
Line 2009 sub run_passback {
|
my $uname = $item->{'uname'}; |
my $uname = $item->{'uname'}; |
my $udom = $item->{'udom'}; |
my $udom = $item->{'udom'}; |
my $uhome = $item->{'uhome'}; |
my $uhome = $item->{'uhome'}; |
|
my $usec = $item->{'usec'}; |
my $keynum = $item->{'lti'}->{'cipher'}; |
my $keynum = $item->{'lti'}->{'cipher'}; |
my $crsdef = $item->{'crsdef'}; |
my $crsdef = $item->{'crsdef'}; |
my $scoretype = $item->{'format'}; |
my $scoretype = $item->{'format'}; |
Line 2041 sub run_passback {
|
Line 2043 sub run_passback {
|
if (($pbscope eq 'map') || ($pbscope eq 'nonrec')) { |
if (($pbscope eq 'map') || ($pbscope eq 'nonrec')) { |
if ((keys(%total_by_symb)) && (keys(%possible_by_symb))) { |
if ((keys(%total_by_symb)) && (keys(%possible_by_symb))) { |
($total,$possible) = |
($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 { |
} else { |
($total,$possible) = &get_lti_score($uname,$udom,$map,$pbscope); |
($total,$possible) = &get_lti_score($uname,$udom,$usec,$map,$pbscope); |
} |
} |
} elsif ($pbscope eq 'course') { |
} elsif ($pbscope eq 'course') { |
($total,$possible) = &get_lti_score($uname,$udom); |
($total,$possible) = &get_lti_score($uname,$udom,$usec); |
} |
} |
$item->{'total'} = $total; |
$item->{'total'} = $total; |
$item->{'possible'} = $possible; |
$item->{'possible'} = $possible; |
Line 2082 sub run_passback {
|
Line 2084 sub run_passback {
|
} |
} |
$value=~s/\&$//; |
$value=~s/\&$//; |
&Apache::lonnet::courselog(&escape($linkuri).':'.$uname.':'.$udom.':EXPORT:'.$value); |
&Apache::lonnet::courselog(&escape($linkuri).':'.$uname.':'.$udom.':EXPORT:'.$value); |
&Apache::lonnet::cstore({'score' => $score},$skey,$namespace,$udom,$uname,'',$ip,1); |
&Apache::lonnet::store_userdata({'score' => $score},$skey,$namespace,$udom,$uname,$ip); |
} |
} |
} else { |
} else { |
if ($item->{'linkprot'}) { |
if ($item->{'linkprot'}) { |
Line 2111 sub run_passback {
|
Line 2113 sub run_passback {
|
$no_passback .= " LTI launcher $linkprotector ($appname) for $linkuri (${cdom}_${cnum})"; |
$no_passback .= " LTI launcher $linkprotector ($appname) for $linkuri (${cdom}_${cnum})"; |
&Apache::lonnet::logthis($no_passback." for $uname:$udom"); |
&Apache::lonnet::logthis($no_passback." for $uname:$udom"); |
&Apache::lonnet::log($udom,$uname,$uhome,"$no_passback score=$score total=$total poss=$possible"); |
&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); |
|
} |
} |
} |
} |
} |
} |
} |
Line 2121 sub run_passback {
|
Line 2127 sub run_passback {
|
} |
} |
|
|
sub get_lti_score { |
sub get_lti_score { |
my ($uname,$udom,$mapurl,$pbscope,$totals,$possibles) = @_; |
my ($uname,$udom,$usec,$mapurl,$pbscope,$totals,$possibles) = @_; |
my $navmap = Apache::lonnavmaps::navmap->new($uname,$udom); |
my $navmap = Apache::lonnavmaps::navmap->new($uname,$udom,$usec); |
if (ref($navmap)) { |
if (ref($navmap)) { |
my $iterator; |
my $iterator; |
if ($mapurl ne '') { |
if ($mapurl ne '') { |