Merge branch 'MDL-49776-master' of git://github.com/lameze/moodle
authorDan Poltawski <dan@moodle.com>
Tue, 26 May 2015 10:53:34 +0000 (11:53 +0100)
committerDan Poltawski <dan@moodle.com>
Tue, 26 May 2015 10:53:34 +0000 (11:53 +0100)
mod/lti/locallib.php

index c51dda6..28ab4fc 100644 (file)
@@ -368,15 +368,13 @@ function lti_build_request($instance, $typeconfig, $course, $typeid = null, $isl
     }
     $placementsecret = $instance->servicesalt;
 
-    if ( isset($placementsecret) ) {
-        $sourcedid = json_encode(lti_build_sourcedid($instance->id, $USER->id, $placementsecret, $typeid));
-        $requestparams['lis_result_sourcedid'] = $sourcedid;
-    }
-
     if ( isset($placementsecret) && ($islti2 ||
          $typeconfig['acceptgrades'] == LTI_SETTING_ALWAYS ||
          ($typeconfig['acceptgrades'] == LTI_SETTING_DELEGATE && $instance->instructorchoiceacceptgrades == LTI_SETTING_ALWAYS))) {
 
+        $sourcedid = json_encode(lti_build_sourcedid($instance->id, $USER->id, $placementsecret, $typeid));
+        $requestparams['lis_result_sourcedid'] = $sourcedid;
+
         // Add outcome service URL.
         $serviceurl = new \moodle_url('/mod/lti/service.php');
         $serviceurl = $serviceurl->out();