version 1.16, 2018/01/01 01:29:38
|
version 1.18, 2018/01/31 14:17:44
|
Line 274 sub lti_params {
|
Line 274 sub lti_params {
|
unless (grep(/^\Q$ltirole\E$/,@possroles)) { |
unless (grep(/^\Q$ltirole\E$/,@possroles)) { |
$ltirole = 'Learner'; |
$ltirole = 'Learner'; |
} |
} |
|
my @possdigest; |
my $digest_user = &Encode::decode_utf8($uname.':'.$udom); |
my $digest_user = &Encode::decode_utf8($uname.':'.$udom); |
$digest_user = &Digest::SHA::sha1_hex($digest_user); |
$digest_user = &Digest::SHA::sha1_hex($digest_user); |
|
push(@possdigest,$digest_user); |
if ($env{'course.'.$env{'request.course.id'}.'.languages'} ne '') { |
if ($env{'course.'.$env{'request.course.id'}.'.languages'} ne '') { |
@userlangs=(@userlangs,split(/\s*(\,|\;|\:)\s*/, |
@userlangs=(@userlangs,split(/\s*(\,|\;|\:)\s*/, |
$env{'course.'.$env{'request.course.id'}.'.languages'})); |
$env{'course.'.$env{'request.course.id'}.'.languages'})); |
Line 298 sub lti_params {
|
Line 300 sub lti_params {
|
if ($symb) { |
if ($symb) { |
$digest_symb = &Encode::decode_utf8($symb); |
$digest_symb = &Encode::decode_utf8($symb); |
$digest_symb = &Digest::SHA::sha1_hex($digest_symb); |
$digest_symb = &Digest::SHA::sha1_hex($digest_symb); |
|
push(@possdigest,$digest_symb); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
if (ref($navmap)) { |
if (ref($navmap)) { |
my $res = $navmap->getBySymb($symb); |
my $res = $navmap->getBySymb($symb); |
Line 338 sub lti_params {
|
Line 341 sub lti_params {
|
$crsprotocol = 'http'; |
$crsprotocol = 'http'; |
} |
} |
if (($passback) || ($roster)) { |
if (($passback) || ($roster)) { |
|
my (%currdigest,%digesthash); |
|
if (@possdigest) { |
|
%currdigest = &Apache::lonnet::get('exttools',\@possdigest, |
|
$cdom,$cnum); |
|
} |
if ($passback) { |
if ($passback) { |
$ltiparams{'lis_outcome_service_url'} = $crsprotocol.'://'.$crshostname.'/adm/service/passback'; |
$ltiparams{'lis_outcome_service_url'} = $crsprotocol.'://'.$crshostname.'/adm/service/passback'; |
$ltiparams{'ext_ims_lis_basic_outcome_url'} = $ltiparams{'lis_outcome_service_url'}; |
$ltiparams{'ext_ims_lis_basic_outcome_url'} = $ltiparams{'lis_outcome_service_url'}; |
Line 355 sub lti_params {
|
Line 363 sub lti_params {
|
} |
} |
} |
} |
} |
} |
my %digesthash; |
|
if ($ltiparams{'lis_result_sourcedid'}) { |
|
$digesthash{$ltiparams{'lis_result_sourcedid'}} = "$idx\0".time; |
|
} |
|
if ($ltiparams{'ext_ims_lis_memberships_id'}) { |
|
$digesthash{$ltiparams{'ext_ims_lis_memberships_id'}} = "$idx\0".time; |
|
} |
|
if (($digest_symb) && ($gradesecret || $rostersecret)) { |
if (($digest_symb) && ($gradesecret || $rostersecret)) { |
$digesthash{$digest_symb} = $symb; |
unless ((exists($currdigest{$digest_symb})) && ($currdigest{$digest_symb} eq $symb)) { |
|
$digesthash{$digest_symb} = $symb; |
|
} |
} |
} |
if (($passback) && ($gradesecret)) { |
if (($passback) && ($gradesecret)) { |
$digesthash{$digest_user} = $uname.':'.$udom; |
unless ((exists($currdigest{$digest_user})) && ($currdigest{$digest_user} eq $uname.':'.$udom)) { |
|
$digesthash{$digest_user} = $uname.':'.$udom; |
|
} |
} |
} |
if (keys(%digesthash)) { |
if (keys(%digesthash)) { |
&Apache::lonnet::put('exttools',\%digesthash,$cdom,$cnum); |
&Apache::lonnet::put('exttools',\%digesthash,$cdom,$cnum); |
Line 478 sub gradabletool_access_check {
|
Line 483 sub gradabletool_access_check {
|
@targets = ('web'); |
@targets = ('web'); |
} |
} |
foreach my $target (@targets) { |
foreach my $target (@targets) { |
undef(%Apache::lonhomework::results); |
&Apache::structuretags::initialize_storage($symb); |
undef(%Apache::lonhomework::history); |
|
%Apache::lonhomework::history = |
|
&Apache::lonnet::restore($symb,$courseid,$udom,$uname); |
|
&Apache::lonhomework::set_show_problem_status(&Apache::lonnet::EXT('resource.0.problemstatus')); |
&Apache::lonhomework::set_show_problem_status(&Apache::lonnet::EXT('resource.0.problemstatus')); |
my ($accessmsg,$slot_name,$slot,$ipused); |
my ($accessmsg,$slot_name,$slot,$ipused); |
($status,$accessmsg,$slot_name,$slot,$ipused) = |
($status,$accessmsg,$slot_name,$slot,$ipused) = |
Line 512 sub gradabletool_access_check {
|
Line 514 sub gradabletool_access_check {
|
} |
} |
} |
} |
} |
} |
|
if (keys(%Apache::lonhomework::results)) { |
|
&Apache::structuretags::finalize_storage(); |
|
} |
} |
} |
return ($status,$result,$resource_due); |
return ($status,$result,$resource_due); |
} |
} |