LTI
class LTI
This is a general purpose LTI class with no Tsugi-specific dependencies.
This class handles the protocol and OAuth validation and does not deal with how to use LTI data during the runtime of the tool.
Methods
Determines if this is a valid Basic LTI message
Determines if this is a valid Basic LTI message
No description
No description
Verify the message signature for this request
No description
No description
No description
No description
Lower case and turn non letters / numbers into underscores per LTI 1.1
No description
No description
No description
No description
No description
No description
No description
No description
No description
Retrieve a grade using the LTI 1.1 protocol (POX)
Send a grade using the LTI 1.1 protocol (POX)
No description
No description
No description
No description
No description
No description
No description
Send a grade using the JSON protocol from IMS LTI 2.x
Return an array suitable for sending to the LTI 2.x result_url
Send setings data using the JSON protocol from IMS LTI 2.x
Send a JSON body LTI 2.x Style
ltiLinkUrl - Returns true if we can return LTI Links for this launch
getLtiLinkJson - Get a JSON object for an LTI Link Content Item Return
No description
No description
Details
at line 33
static
isRequestCheck($request_data = false)
Determines if this is a valid Basic LTI message
at line 50
static
isRequest($request_data = false)
Determines if this is a valid Basic LTI message
Returns true if this is a Basic LTI message with minimum values to meet the protocol
at line 61
static
isValidMessageType($lti_message_type)
at line 68
static
isValidVersion($lti_version)
at line 79
static mixed
verifyKeyAndSecret($key, $secret, $http_url = NULL, $parameters = null, $http_method = NULL)
Verify the message signature for this request
at line 104
static
signParameters($oldparms, $endpoint, $method, $oauth_consumer_key, $oauth_consumer_secret, $submit_text = false, $org_id = false, $org_desc = false)
at line 148
static
postLaunchHTML($newparms, $endpoint, $debug = false, $iframeattr = false, $endform = false)
at line 256
static
get_string($key, $bundle)
at line 260
static
bodyRequest($url, $method, $data, $optional_headers = null)
at line 286
static
mapCustomName($name)
Lower case and turn non letters / numbers into underscores per LTI 1.1
http://www.imsglobal.org/specs/ltiv1p1p1/implementation-guide
When there are custom name / value parameters in the launch, a POST parameter is included for each custom parameter. The parameter names are mapped to lower case and any character that is neither a number nor letter in a parameter name is replaced with an "underscore". So if a custom entry was as follows:
Review:Chapter=1.2.56
would be mapped to:
custom_review_chapter=1.2.56
at line 298
static
addCustom($parms, $custom)
at line 317
static
getLastOAuthBodyBaseString()
at line 322
static
getLastOAuthBodyHashInfo()
at line 327
static
getAuthorizationHeader()
at line 335
static
getContentTypeHeader()
at line 344
static
getOAuthKeyFromHeaders()
at line 358
static
handleOAuthBodyPOST($oauth_consumer_key, $oauth_consumer_secret, $postdata = false)
at line 407
static
sendOAuthGET($endpoint, $oauth_consumer_key, $oauth_consumer_secret, $accept_type, $signature = false)
at line 433
static
sendOAuthBody($method, $endpoint, $oauth_consumer_key, $oauth_consumer_secret, $content_type, $body, $more_headers = false, $signature = false)
at line 485
static mixed
getPOXGrade($sourcedid, $service, $key_key, $secret, $debug_log = false, $signature = false)
Retrieve a grade using the LTI 1.1 protocol (POX)
This retrieves a grade using the Plain-Old-XML protocol from IMS LTI 1.1
at line 572
static mixed
sendPOXGrade($grade, $sourcedid, $service, $key_key, $secret, $debug_log = false, $signature = false)
Send a grade using the LTI 1.1 protocol (POX)
This sends a grade using the Plain-Old-XML protocol from IMS LTI 1.1
at line 629
static
getPOXGradeRequest()
at line 661
static
getPOXRequest()
at line 685
static
getPOXResponse()
at line 706
static
getContextMemberships($membershipsid, $membershipsurl, $key_key, $secret, $groups = false, $signature = false, $debug_log = false)
at line 744
static
parseContextMembershipsResponse($response)
at line 787
static
replaceResultRequest($grade, $sourcedid, $endpoint, $oauth_consumer_key, $oauth_consumer_secret, $signature = false)
at line 803
static
parseResponse($response)
at line 845
static mixed
sendJSONGrade($grade, $comment, $result_url, $key_key, $secret, $debug_log = false, $signature = false)
Send a grade using the JSON protocol from IMS LTI 2.x
at line 875
static
getResultJSON($grade, $comment)
Return an array suitable for sending to the LTI 2.x result_url
at line 900
static mixed
sendJSONSettings($settings, $settings_url, $key_key, $secret, $debug_log = false, $signature = false)
Send setings data using the JSON protocol from IMS LTI 2.x
at line 939
static mixed
sendJSONBody($method, $postBody, $content_type, $rest_url, $key_key, $secret, $debug_log = false, $signature = false)
Send a JSON body LTI 2.x Style
at line 964
static string
ltiLinkUrl($postdata = false)
ltiLinkUrl - Returns true if we can return LTI Links for this launch
IMS Public Draft: http://www.imsglobal.org/specs/lticiv1p0
at line 987
static
getLtiLinkJSON($url, $title = false, $text = false, $icon = false, $fa_icon = false, $custom = false)
getLtiLinkJson - Get a JSON object for an LTI Link Content Item Return