This is a very simple reference implementaton of the LMS side (i.e. consumer) for IMS LTI 1.1.
\n"); require_once("util/lti_util.php"); $cur_url = curPageURL(); $lmsdata = array( "resource_link_id" => "120988f929-274612", "resource_link_title" => "Weekly Blog", "resource_link_description" => "A weekly blog.", "user_id" => "292832126", "roles" => "Instructor", // or Learner "lis_person_name_full" => 'Jane Q. Public', "lis_person_name_family" => 'Public', "lis_person_name_given" => 'Given', "lis_person_contact_email_primary" => "user@school.edu", "lis_person_sourcedid" => "school.edu:user", "context_id" => "456434513", "context_title" => "Design of Personal Environments", "context_label" => "SI182", "tool_consumer_info_product_family_code" => "ims", "tool_consumer_info_version" => "1.1", "tool_consumer_instance_guid" => "lmsng.school.edu", "tool_consumer_instance_description" => "University of School (LMSng)", // 'launch_presentation_return_url' => $cur_url ); foreach ($lmsdata as $k => $val ) { if ( $_POST[$k] && strlen($_POST[$k]) > 0 ) { $lmsdata[$k] = $_POST[$k]; } } $key = trim($_REQUEST["key"]); if ( ! $key ) $key = "12345"; $secret = trim($_REQUEST["secret"]); if ( ! $secret ) $secret = "secret"; $endpoint = trim($_REQUEST["endpoint"]); $b64 = base64_encode($key.":::".$secret); if ( ! $endpoint ) $endpoint = str_replace("lms.php","auto.php",$cur_url); $cssurl = str_replace("lms.php","lms.css",$cur_url); $outcomes = trim($_REQUEST["outcomes"]); if ( ! $outcomes ) { $outcomes = str_replace("lms.php","common/tool_consumer_outcome.php",$cur_url); $outcomes .= "?b64=" . htmlentities($b64); } $tool_consumer_instance_guid = $lmsdata['tool_consumer_instance_guid']; $tool_consumer_instance_description = $lmsdata['tool_consumer_instance_description']; ?> Toggle Resource and Launch Data \n"); echo("\n"); echo("\n"); echo("Note: Unpublished drafts of IMS Specifications are only available to IMS members and any software based on an unpublished draft is subject to change. Sample code is provided to help developers understand the specification more quickly. Simply interoperating with this sample implementation code does not allow one to claim compliance with a specification.