[LON-CAPA-cvs] cvs: loncom /lti ltiutils.pm
raeburn
raeburn at source.lon-capa.org
Tue Aug 14 13:24:22 EDT 2018
raeburn Tue Aug 14 17:24:22 2018 EDT
Modified files:
/loncom/lti ltiutils.pm
Log:
- Bug 6754 LON-CAPA as LTI Provider
- Checking if gradesecret has expired.
- config in days; convert to seconds
- config items are gradesecret & gradesecretdate
Index: loncom/lti/ltiutils.pm
diff -u loncom/lti/ltiutils.pm:1.13 loncom/lti/ltiutils.pm:1.14
--- loncom/lti/ltiutils.pm:1.13 Sun Aug 12 02:24:42 2018
+++ loncom/lti/ltiutils.pm Tue Aug 14 17:24:21 2018
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Utility functions for managing LON-CAPA LTI interactions
#
-# $Id: ltiutils.pm,v 1.13 2018/08/12 02:24:42 raeburn Exp $
+# $Id: ltiutils.pm,v 1.14 2018/08/14 17:24:21 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -276,7 +276,7 @@
my ($has_action, $valid_for);
if ($context eq 'grade') {
$has_action = $ltitools->{'passback'};
- $valid_for = $ltitools->{'passbackvalid'}
+ $valid_for = $ltitools->{'passbackvalid'} * 86400; # convert days to seconds
} elsif ($context eq 'roster') {
$has_action = $ltitools->{'roster'};
$valid_for = $ltitools->{'rostervalid'};
@@ -382,13 +382,13 @@
my $warning;
my ($needsnew,$oldsecret,$lifetime);
if ($name eq 'grade') {
- $lifetime = $ltitools->{'passbackvalid'}
+ $lifetime = $ltitools->{'passbackvalid'} * 86400; # convert days to seconds
} elsif ($name eq 'roster') {
$lifetime = $ltitools->{'rostervalid'};
}
- if ($toolsettings->{$name} eq '') {
+ if ($toolsettings->{$name.'secret'} eq '') {
$needsnew = 1;
- } elsif (($toolsettings->{$name.'date'} + $lifetime) < $now) {
+ } elsif (($toolsettings->{$name.'secretdate'} + $lifetime) < $now) {
$oldsecret = $toolsettings->{$name.'secret'};
$needsnew = 1;
}
More information about the LON-CAPA-cvs
mailing list