From 461bde28d8b2501f0d142122f37902aa05200771 Mon Sep 17 00:00:00 2001 From: Charles Severance Date: Tue, 15 Nov 2011 15:47:26 -0500 Subject: [PATCH] MDL-20534 Add the tool_consumer_info fields and fix parsing of custom parameters. --- mod/lti/locallib.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mod/lti/locallib.php b/mod/lti/locallib.php index 24650853e76fb..bb53e6f0be7b7 100644 --- a/mod/lti/locallib.php +++ b/mod/lti/locallib.php @@ -173,6 +173,9 @@ function lti_view($instance) { $requestparams['launch_presentation_return_url'] = $returnurl; } + $requestparams['tool_consumer_info_product_family_code'] = 'moodle'; + $requestparams['tool_consumer_info_version'] = strval($CFG->version); + if (!empty($key) && !empty($secret)) { $parms = lti_sign_parameters($requestparams, $endpoint, "POST", $key, $secret); } else { @@ -422,7 +425,7 @@ function lti_split_custom_parameters($customstr) { continue; } $key = trim($textlib->substr($line, 0, $pos)); - $val = trim($textlib->substr($line, $pos+1)); + $val = trim($textlib->substr($line, $pos+1, strlen($line))); $key = lti_map_keyname($key); $retval['custom_'.$key] = $val; }