1.0 Basic Functionality 1.1 Log in as administrator, "Site Administration -> Plugins -> Activity Modules -> Basic LTI" and create a new Basic LTI activity 1.2 Name the tool "IMS Test", and set the following values: URL: http://www.imsglobal.org/developers/BLTI/tool.php Key: 12345 Secret: secret Leave all of the rest of the values default and create the tool 1.3 Create a course, enroll an teacher and a student to the course. Make sure the accounts have first names, last names, and e-mail addresses. Note: You can save a lot of login/logout cycles by simply using two or three different browsers (FireFox, Safari and Firefox) - one for the administrator, teacher and the student. 1.4 As the teacher, add an "IMS Test" activity to your course. Give the activity a title and description and leave the rest of the fields default. 1.5 Launch the activity as the teacher. You should see the IMS Test tool output in the frame. You should see the blue bar, and a dump of the post data. You should not see any error such as a 'Bad secret' You should not see the name information or email address of the user in the data dump. You should see "roles=Instructor" in the data dump. 1.6 Launch the activity as a student. You should see the IMS Test tool output in the frame. You should see the blue bar, and a dump of the post data. You should not see any error such as a 'Bad secret' You should not see the name information or email address of the user in the data du mp. You should see "roles=Learner" in the data dump. 1.7 As the administrator go to the activity configuration screen, leave the URL and Key but change the secret to xxxx - press and save the activity. 1.8 Launch the activity as the teacher - the tool should say "Could not establish context: Invalid Signature" 1.9 As the administrator go to the activity configuration screen and change the secret back to "secret" and also change "Send user name" to "Delegate to Professor" and the "Set default" should become active and set it to "Do not Send". Change the "Send email" to "Delegate to Professor" and set its default to "Send". Save the activity. 1.10 As the teacher, add another new placement of the activity to the course with a title and description. Verify that "Send user names" is active and defaults to "Do not send". Verify that "Send E-mail" is active and defaults to "Send". Leave the defaults unchanged and "Save and Display". Looking at the dump verify that "lis_person_contact_email_primary" is indeed set but the names have not been sent. 1.11 As the teacher edit the activity, and switch "Send names" to "Send" and "Send Email" to "Do not send" (i.e. flip them) - Save and Display the activity. You should see values for lis_person_name_given, lis_person_name_family, and lis_person_name_full but not lis_person_contact_email_primary. 1.12 As the teacher, again edit the activity, setting the "Send names" and "Send Email" to "Send". Also change the "Popup Option" to "Launch in New Window" and Save and display. The launch should happen in a new window and both the name and E-Mail information should be present. 1.13 As the adminstrator, go back to the activity and set "Send user name" and "Send user email" back to Never and save the activity. (i.e. we are revoking the teacher's right to make the decision). 1.14 As the teacher launch the activity and verify that neither the nameing nor email fields are present in the launch. 1.15 As the teacher, edit the activity, change the Popup Option back to "Launch in moodle" and change "Debug Option" to "Debug Launch" and Save and Display. The tool should once again launch inside of Moodle. But it will not go directly to the external tool. You should see a button titled "Press to launch this activity" and a link titled "Toggle Debug Data". Toggle the Debug Data and you should see the values that Moodle is about to send to the external tool. You should be able to shown and hid the debug data bu pressing the Toggle link. When you press the "Launch" button, it should continue to tool and the tool output should display normally. 1.16 As the teacher, edit the activity and turn off Debug Launch and Save and Display and verify that the launch goes directly to the tool without pausing to show the debug data. 1.17 As the teacher and set the frame height to be 100 and press Save and Display. The tool should display ina very small frame. 1.18 As the teacher edit the activity and set the frame height to be 1200 and press Save and Display. The framesize should be 1200. 1.19 As the administrator, edit the activity and enter the string "x=123;y=456" in the Custom parameters section (no quotes) and press Save Changes. 1.20 As the teacher relaunch the activity. You should see two parameters "custom_y=456" and "custom_x=123" in the debug data. 1.21 As the administrator, edit the activity and replace the custom section and enter two lines in the custom parameter section. The first line should be "a.B+c=789" and the second line should be "l_mN=543" (no quotes on either line) and press Save Changes. 1.22 As the teacher relaunch the activity. You should see two parameters in the tool output - "custom_a_b_c=789" and "custom_l_mn=543" 2.0 Service Call Backs 2.1 Navigate your browser to the URL "/mod/basiclti/service.php" - It should say "Fail Error Improperly formed message: wrong lti version". 2.2 As administrator, edit the activity, and set "Accept grades", "Allow roster access", and "Store Settings" to "Always" and press "Save changes". 2.3 Navigate your browser to the URL "/mod/basiclti/service.php" - It should still say "Fail Error Improperly formed message: wrong lti version". 2.4 As administrator, edit the activity, and set "Accept grades", "Allow roster access", and "Store Settings" to "Always" and press "Save changes". 2.5 As the student, launch the activity. You should see three new links in the tool, one for outcomes, one for roster, and one for settings. We will test each in turn. 2.6 As the student press the "Test grade send" option. You should see a screen with a URL, key, secret and a long "lis_result_sourcedid". Press "Read Grade" - you should get an error "Unable to read grade". Put a grade such as "0.91" in the grade field and press "Send Grade" - you should get an XML response that says "Grade updated". 2.7 As the student go to the Grades section in the course and verify that the grade is indeed in the grade book as 91/100. 2.8 Note that the service will accept grades for teachers but the teacher grades do not show up in the Grade book section in Moodle. 2.9 As the student once again launch the activity. Once again press the "Send grades" link. Press the "Read Grade" button and you should see a grade of 0.91. The press the "Delete Grade" button and you should see an XML response of "Grade updated". Once again press "Read Grade" and it should say "Unable to read grade". Once again go back to the Moodle gradebook and verify that the student no longer has a grade. 2.10 As the student, once again launch the activity. This time we will exercise the tool setting service. Go into the tool setting screen. Press "Read Setting" - the value data in the XML response should be empty. Enter some text into the setting field and press "Send Setting" - the XML response should say "Setting updated". 2.11 As the student relaunch the activity and look through the dump of the post parameters. You should see a parameter of the form "ext_ims_lti_tool_setting=Some Text" (or whatever you entered as the setting). Relaunch the activity and go into the "Exercise Tools Setting" tool. Press "Read Setting" and you should see your text in the "" tag in the returned XML. Then press "Delete Setting" it should say "setting deleted" in the returned XML. Then press "Read Setting" and the "" tag should be empty. 2.12 As the student again relaunch the activity and verify that the ext_ims_lti_tool_setting in the post parameters is now empty. 2.13 As the student relaunch the activity and enter the "retrieve roster" screen. Press the "Read Roster" button. You should see a roster that reflects the enrolments in the course (remember we enrolled one student and one Reacher in the course). Since the last time the administrator edited the activity we set the "send email" and "send names" to "Never" we should not see either user names or user email in the retrieved roster. We should see a lis_result_sourcedid value for each of the course members. 2.14 As the administrator, edit the activity, Change "Send user name" and "Send email" to "Always" and set "Accept grades" to "Never" and Save the activity. 2.15 As the student, relaunch the activity. The "set grades" link should no longer appear. Enter the roster retrieval in the tool and press "Read Roster". You shold see names and email addresses in the roster for each user but you should not see any lis_result_sourcedid values. 2.16 This next test is a little tricky and requires two browsers. As the adminstrator, go back to the activity and edit the activity to accpet grades and save the activity. 2.17 As the student relaunch the activity and the "send grade" link should reappear. Enter the grade test screen and enter a grade of "0.96" and press "Send Grade" it should succeed and it should say "Grade Updated". Press "Read Grade" and you should see the new grade. 2.18 Without disturbing the student screen, as the administrator go into the activity and set "accept grades" to never and save the activity. 2.19 As the student back in the undisturbed browser, you should still be on the grade testing page. Press "Read Grade" - you should see an error of "not permitted". Enter a different grade such as "0.99" and press "Send Grade" and you should see and error of "not permitted". 2.20 As the student, relaunch the activity. Notice the missing "send grade" link. Enter the "roster retrieval" test and press "Read Roster" - it should succeed. 2.21 Change the secret in the read roster screen to "xxxx" and press "Read Roster" - you should get an "Invalid Signature" error. Change the secret back to "secret" and press "Read Roster" and it should again properly retrieve the roster. 2.21 Without disturbing the student screen, as the administrator edit the activity and set "retrieve roster" to "Never" and save the activity. 2.22 Again as the student in the undisturbed browser press the "Read Roster" button - it should fail with a "Not Permitted" error. 2.23 Without disturbing the student screen, as the administrator edit the activity and set "retrieve roster" to "Always" and save the activity. 2.24 Again as the student in the undisturbed browser press the "Read Roster" button - it should succeed. 2.25 Without disturbing the student screen, as the administrator edit the activity and change the secret to "xxxx" and save the activity. 2.26 Again as the student in the undisturbed browser press the "Read Roster" button - it should fail with a message of "Invalid Signature". 2.27 As administrator go back and change the secret back to "secret"