celtic-project / wordpress-lti

LTI Connector for WordPress
GNU General Public License v3.0
23 stars 11 forks source link

How to extract launch course data from $tool_provider? #3

Closed spinozarabel closed 5 years ago

spinozarabel commented 5 years ago

Gretings, I need to extract the course from which the LTI has been launched in order to set course dependent options before directing users to appropriate blog (site) in the WP multi-site destination, using the file doConnect.php in the includes library. Could you suggest how to do this? By printing out the class, I notice that [lti_context_id] is carrying the course ID in my case but I have no idea how to access it. I am using Moodle 3.7+ and latest Wordpress 5.2.2. Thank you.

spinozarabel commented 5 years ago

Sorry, I found the answer myself, $tool_provider->resource_link->lti_context_id Closing..