|
@@ -63,10 +63,10 @@ if ($tool->isActiveDeepLinking()) {
|
|
|
$params['lis_result_sourcedid'] = $toolEval->getId().':'.$user->getId();
|
|
|
$params['lis_outcome_service_url'] = api_get_path(WEB_PATH).'ims_lti/outcome_service/'.$tool->getId();
|
|
|
$params['lis_person_sourcedid'] = "$platformDomain:$toolUserId";
|
|
|
- $params['lis_course_offering_sourcedid'] = "$platformDomain:".$course->getId();
|
|
|
+ $params['lis_course_section_sourcedid'] = "$platformDomain:".$course->getId();
|
|
|
|
|
|
if ($session) {
|
|
|
- $params['lis_course_offering_sourcedid'] .= ':'.$session->getId();
|
|
|
+ $params['lis_course_section_sourcedid'] .= ':'.$session->getId();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -111,7 +111,39 @@ $params['tool_consumer_instance_url'] = api_get_path(WEB_PATH);
|
|
|
$params['tool_consumer_instance_contact_email'] = api_get_setting('emailAdministrator');
|
|
|
$params['oauth_callback'] = 'about:blank';
|
|
|
|
|
|
-$params += $tool->parseCustomParams();
|
|
|
+$customParams = $tool->parseCustomParams();
|
|
|
+$imsLtiPlugin->trimParams($customParams);
|
|
|
+
|
|
|
+$substitutables = ImsLti::getSubstitutableParams($user, $course, $session);
|
|
|
+$variables = array_keys($substitutables);
|
|
|
+
|
|
|
+foreach ($customParams as $customKey => $customValue) {
|
|
|
+ if (in_array($customValue, $variables)) {
|
|
|
+ $val = $substitutables[$customValue];
|
|
|
+
|
|
|
+ if (is_array($val)) {
|
|
|
+ $val = current($val);
|
|
|
+
|
|
|
+ if (array_key_exists($val, $params)) {
|
|
|
+ $customParams[$customKey] = $params[$val];
|
|
|
+
|
|
|
+ continue;
|
|
|
+ } else {
|
|
|
+ $val = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (false === $val) {
|
|
|
+ $customParams[$customKey] = $customValue;
|
|
|
+
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ $customParams[$customKey] = $substitutables[$customValue];
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+$params += $customParams;
|
|
|
|
|
|
$imsLtiPlugin->trimParams($params);
|
|
|
|