version 1.17.2.5, 2024/02/27 04:13:34
|
version 1.17.2.6, 2025/01/16 21:52:05
|
Line 34 use Digest::SHA;
|
Line 34 use Digest::SHA;
|
use Digest::MD5 qw(md5_hex); |
use Digest::MD5 qw(md5_hex); |
use Encode; |
use Encode; |
use UUID::Tiny ':std'; |
use UUID::Tiny ':std'; |
|
use HTTP::Status; |
use LWP::UserAgent(); |
use LWP::UserAgent(); |
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::loncommon; |
use Apache::loncommon; |
Line 761 sub send_grade {
|
Line 762 sub send_grade {
|
if ($sigmethod eq '') { |
if ($sigmethod eq '') { |
$sigmethod = 'HMAC-SHA1'; |
$sigmethod = 'HMAC-SHA1'; |
} |
} |
my $request; |
my ($request,$sendit,$respcode,$result); |
if ($msgformat eq '1.0') { |
if ($msgformat eq '1.0') { |
my $date = &Apache::loncommon::utc_string(time); |
my $date = &Apache::loncommon::utc_string(time); |
my %ltiparams = ( |
my %ltiparams = ( |
Line 788 sub send_grade {
|
Line 789 sub send_grade {
|
? join("&$name=", map {escape($_) } @{$hashref->{$_}}) |
? join("&$name=", map {escape($_) } @{$hashref->{$_}}) |
: &escape($hashref->{$_}) ); |
: &escape($hashref->{$_}) ); |
} keys(%{$hashref}))); |
} keys(%{$hashref}))); |
#FIXME Need to handle case where passback failed. |
$sendit = 1; |
} |
} |
} else { |
} else { |
srand( time() ^ ($$ + ($$ << 15)) ); # Seed rand. |
srand( time() ^ ($$ + ($$ << 15)) ); # Seed rand. |
Line 845 END
|
Line 846 END
|
], |
], |
$gradexml, |
$gradexml, |
); |
); |
my $ua=new LWP::UserAgent; |
$sendit = 1; |
$ua->timeout(10); |
|
my $response=$ua->request($request); |
|
my $message=$response->status_line; |
|
#FIXME Handle case where pass back of score to LTI Consumer failed. |
|
} |
} |
} |
} |
|
if ($sendit) { |
|
my $ua=new LWP::UserAgent; |
|
$ua->timeout(10); |
|
my $response=$ua->request($request); |
|
my $message=$response->status_line; |
|
$respcode = $response->code; |
|
$result = HTTP::Status::status_message($respcode); |
|
} |
|
return ($sendit,$score,$respcode,$result); |
} |
} |
|
|
sub setup_logout_callback { |
sub setup_logout_callback { |