Skip to content

Commit

Permalink
MDL-49143 LTI: Fix missing resource id
Browse files Browse the repository at this point in the history
  • Loading branch information
cameorn1730 committed Sep 29, 2015
1 parent ee64a43 commit 833042d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mod/lti/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,12 @@ function lti_build_request($instance, $typeconfig, $course, $typeid = null, $isl
'context_label' => $course->shortname,
'context_title' => $course->fullname,
);
if (!empty($instance->id)) {
$requestparams['resource_link_id'] = $instance->id;
}
if (!empty($instance->resource_link_id)) {
$requestparams['resource_link_id'] = $instance->resource_link_id;
}
if ($course->format == 'site') {
$requestparams['context_type'] = 'Group';
} else {
Expand All @@ -370,7 +376,7 @@ function lti_build_request($instance, $typeconfig, $course, $typeid = null, $isl
}
$placementsecret = $instance->servicesalt;

if ( isset($placementsecret) && ($islti2 ||
if ( !empty($instance->id) && isset($placementsecret) && ($islti2 ||
$typeconfig['acceptgrades'] == LTI_SETTING_ALWAYS ||
($typeconfig['acceptgrades'] == LTI_SETTING_DELEGATE && $instance->instructorchoiceacceptgrades == LTI_SETTING_ALWAYS))) {

Expand Down

0 comments on commit 833042d

Please sign in to comment.