Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-34161

Fix LTI backup and restore to support course and site tools and submissions

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      These tests will require multiple sites to test completely.

      Testing site wide LTI templates:

      1. Navigate to Site Administration > Plugins > Activity modules > External tool
      2. Click on "configure a tool manually"
      3. Configure an LTI tool with the name => 'Test', Base URL => http://ltiapps.net/test/tp.php, Consumer key => password, Shared secret => secret
      4. Create a new course
      5. Add an External tool selecting 'Test' from the 'External tool type' drop down list. Make sure to set the "Launch container" to "Embed".
      6. Backup the External tool
      7. Restore into a new course
      8. Ensure the 'External tool type' drop down displays 'Test'
      9. Check the {lti_types} table and ensure only one entry for the 'Test' tool is present
      10. Restore the site wide tool into a new site. Ensure nothing is added into the {lti_types} table.
      11. The tool will be added without a link to the preconfigured tool, all other data in "Edit settings" form should be the same as in original activity

      Testing course created LTI templates:

      1. Add an External tool to a new course
      2. Select the 'Add external tool configuration' icon in the External tool type row
      3. Add an external tool called 'LTI configured in course' using the details above - make sure it has key and secret
      4. Save the External tool
      5. Backup the External tool
      6. Unzip the backup, find the lti module and make sure the key and secret are stored there encrypted (activities/lti_111/lti.xml)
      7. Restore the backup into the same course (or just duplicate activity)
      8. Ensure the restored External tool is correctly populated with 'LTI configured in course' in the External tool type field
      9. Ensure the {lti_types} table only has one entry for 'LTI configured in course'
      10. Restore (using the backup created 5 steps earlier) the external tool as a new course or into another course
      11. Ensure there is one new entry in the {lti_types} table for 'LTI configured in course' for the new course
      12. Make sure key and secret are present in the preconfigured tool in the restored course
      13. Restore the same backup on another site
      14. Make sure the preconfigured tool was restored in a new course and restored activities point to it
      15. Make sure the restored preconfigured tool does NOT have key and secret
      16. Make sure there is one new entry in the lti_types table

      Testing backup/restore of submissions

      1. Use a site that is accessible from internet (you can use ngrok)
      2. Create an instance of an LTI module with the tool http://ltiapps.net/test/tp.php , key=password , secret=secret (it does not matter if you just enter URL or use predefined tool in this case)
      3. Login as student, go to the "Outcomes", press "Update", enter your own grade (this is a test tool, remember?)
      4. Press "Read" and find how your own grade is retrieved, should be something like <resultScore><language>en</language><textString>0.6</textString></resultScore></result> (it is 0.6 in this example)
      5. In the DB you should have an entry in lti_submission table for this student
      6. As a teacher/admin/manger backup and restore the course with user information
      7. In the restored course student should have a grade and the DB table lti_submission should have corresponding record
      8. As a student go to the restored course and press "Outcomes" and then "Read", you should find your grade there too
      Show
      These tests will require multiple sites to test completely. Testing site wide LTI templates: Navigate to Site Administration > Plugins > Activity modules > External tool Click on "configure a tool manually" Configure an LTI tool with the name => 'Test', Base URL => http://ltiapps.net/test/tp.php , Consumer key => password, Shared secret => secret Create a new course Add an External tool selecting 'Test' from the 'External tool type' drop down list. Make sure to set the " Launch container " to " Embed ". Backup the External tool Restore into a new course Ensure the 'External tool type' drop down displays 'Test' Check the {lti_types} table and ensure only one entry for the 'Test' tool is present Restore the site wide tool into a new site. Ensure nothing is added into the {lti_types} table. The tool will be added without a link to the preconfigured tool, all other data in "Edit settings" form should be the same as in original activity Testing course created LTI templates: Add an External tool to a new course Select the 'Add external tool configuration' icon in the External tool type row Add an external tool called 'LTI configured in course' using the details above - make sure it has key and secret Save the External tool Backup the External tool Unzip the backup, find the lti module and make sure the key and secret are stored there encrypted (activities/lti_111/lti.xml) Restore the backup into the same course (or just duplicate activity) Ensure the restored External tool is correctly populated with 'LTI configured in course' in the External tool type field Ensure the {lti_types} table only has one entry for 'LTI configured in course' Restore (using the backup created 5 steps earlier) the external tool as a new course or into another course Ensure there is one new entry in the {lti_types} table for 'LTI configured in course' for the new course Make sure key and secret are present in the preconfigured tool in the restored course Restore the same backup on another site Make sure the preconfigured tool was restored in a new course and restored activities point to it Make sure the restored preconfigured tool does NOT have key and secret Make sure there is one new entry in the lti_types table Testing backup/restore of submissions Use a site that is accessible from internet (you can use ngrok) Create an instance of an LTI module with the tool http://ltiapps.net/test/tp.php , key=password , secret=secret (it does not matter if you just enter URL or use predefined tool in this case) Login as student, go to the "Outcomes", press "Update", enter your own grade (this is a test tool, remember?) Press "Read" and find how your own grade is retrieved, should be something like <resultScore><language>en</language><textString>0.6</textString></resultScore></result> (it is 0.6 in this example) In the DB you should have an entry in lti_submission table for this student As a teacher/admin/manger backup and restore the course with user information In the restored course student should have a grade and the DB table lti_submission should have corresponding record As a student go to the restored course and press "Outcomes" and then "Read", you should find your grade there too
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_26_STABLE, MOODLE_30_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE
    • Pull Master Branch:
      wip-MDL-34161-master
    • Story Points:
      1.33
    • Sprint:
      3.1 Sprint 7

      Description

      While reviewing MDL-32614 it was discovered that the handling of information in backup & restore, especially related with modules pointing to course or site tools is far from perfect.

      Also it seems that submissions aren't handled at all.

      This issue is about to fix the backup & restore processes to support all that information.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                50 Vote for this issue
                Watchers:
                53 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  15/Jan/18