MDL-49143 LTI: Fix missing resource id
This commit is contained in:
@@ -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 {
|
||||
@@ -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))) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user