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

Integrate LTI Provider support in Moodle

XMLWordPrintable

    • MOODLE_30_STABLE
    • MOODLE_31_STABLE
    • MDL-52035_master
    • Hide

      Prerequisites

      1. You must create a new site called 'lticonsumer' (can be whatever you want just as long as you can identify it is the consumer).
      2. You must create a new site called 'ltiprovider' (can be whatever you want just as long as you can identify it is the provider).

      The reason you must create a new site is because we need the id values to match between the provider and consumer.

      For the LTI consumer site
      1. Restore the attached 'LTI_CONSUMER' backup as a new course.
      2. Enrol a teacher and a student in the course.
      3. Visit your database and perform the following SQL query (this value represents the LTI consumer identity).

        UPDATE mdl_lti SET resourcekey = 'lticonsumer'
        

      4. Perform the following SQL query (because of MDL-36580 we need to do this).

        UPDATE mdl_lti SET password = '97885b76bd48520ba71898db727b4911'
        

      5. Now you need to change the URL to point to your LTI provider. Note - you will need to change '<yourwwwroot>'.

        UPDATE mdl_lti SET toolurl = replace(toolurl, 'http://localhost/lti', '<yourwwwroot>')
        

      For the LTI provider site
      1. Visit 'Site administration' > 'Plugins' > 'Authentication' > 'Manage authentication'.
      2. Enable 'LTI'.
      3. Visit 'Site administration' > 'Plugins' > 'Enrolments' > 'Manage enrol plugins'.
      4. Enable 'Shared external tool'.
      5. Restore the attached 'LTI_PROVIDER' backup as a new course.

      Test 1

      1. Log in as a teacher on the LTI consumer site.
      2. Visit all the LTI activities except the 'Course - LTI' activity and ensure you are restricted to perform actions only a teacher would be able to in the activity.

      Test 2

      1. Log in as a student on the LTI consumer site.
      2. Visit all the LTI activities except the 'Course - LTI' activity and ensure you are restricted to perform actions only a student would be able to in the activity.

      Test 3.

      1. Delete all users on your LTI provider site that came from the LTI consumer.
      2. Log in as a student on the LTI consumer site.
      3. Visit the course and click on the 'course' LTI activity.
      4. Ensure you are restricted to perform actions only a student would be able to in the course.

      Test 4.

      1. Log in as a teacher on the LTI consumer site.
      2. Visit the course and click on the 'course' LTI activity.
      3. Ensure you are restricted to perform actions only a teacher would be able to in the course.

      Test 5 - Grade synchronisation task.

      On your LTI provider site
      1. Unenrol all users from the course in your LTI provider.
      2. Visit 'Site administration > Server > Scheduled tasks'.
      3. Change the 'sync_grades' task so that it runs every minute.
      On your LTI consumer site
      1. Log in as a student and visit the course.
      2. Click on 'Assignment LTI'.
      3. Add a submission.
      On your LTI provider site
      1. Go to the course as a teacher (or admin).
      2. Grade the submission 80/100.
      3. Run the cron.
      On your LTI consumer site
      1. As the student view the gradebook and check that you have the grade 80/100.
      On your LTI provider site
      1. Grade the submission again but this time give it 90/100.
      2. Make sure you have waited more than a minute.
      3. Run the cron again.
      On your LTI consumer site
      1. As the student view the gradebook and check that you have the grade 90/100.
      On your LTI provider site
      1. Make sure you have waited more than a minute.
      2. Run the cron again.
      3. Check that there is a message saying the grades were not synced due to the grades being the same.
      On your LTI consumer site
      1. As the student view the gradebook and check that you still have the grade 90/100.
      On your LTI provider site
      1. Visit 'Site administration > Plugins > Authentication > Manage authentication'.
      2. Disabled the LTI plugin.
      3. Make sure you have waited more than a minute.
      4. Run the cron again.
      5. Check that there is a message saying the authentication plugin is disabled and task has been skipped.
      6. Visit 'Site administration > Plugins > Authentication > Manage authentication'.
      7. Enable the LTI plugin.
      Show
      Prerequisites You must create a new site called 'lticonsumer' (can be whatever you want just as long as you can identify it is the consumer). You must create a new site called 'ltiprovider' (can be whatever you want just as long as you can identify it is the provider). The reason you must create a new site is because we need the id values to match between the provider and consumer. For the LTI consumer site Restore the attached 'LTI_CONSUMER' backup as a new course. Enrol a teacher and a student in the course. Visit your database and perform the following SQL query (this value represents the LTI consumer identity). UPDATE mdl_lti SET resourcekey = 'lticonsumer' Perform the following SQL query (because of MDL-36580 we need to do this). UPDATE mdl_lti SET password = '97885b76bd48520ba71898db727b4911' Now you need to change the URL to point to your LTI provider. Note - you will need to change '<yourwwwroot>' . UPDATE mdl_lti SET toolurl = replace(toolurl, 'http://localhost/lti', '<yourwwwroot>') For the LTI provider site Visit 'Site administration' > 'Plugins' > 'Authentication' > 'Manage authentication'. Enable 'LTI'. Visit 'Site administration' > 'Plugins' > 'Enrolments' > 'Manage enrol plugins'. Enable 'Shared external tool'. Restore the attached 'LTI_PROVIDER' backup as a new course. Test 1 Log in as a teacher on the LTI consumer site. Visit all the LTI activities except the 'Course - LTI' activity and ensure you are restricted to perform actions only a teacher would be able to in the activity. Test 2 Log in as a student on the LTI consumer site. Visit all the LTI activities except the 'Course - LTI' activity and ensure you are restricted to perform actions only a student would be able to in the activity. Test 3. Delete all users on your LTI provider site that came from the LTI consumer. Log in as a student on the LTI consumer site. Visit the course and click on the 'course' LTI activity. Ensure you are restricted to perform actions only a student would be able to in the course. Test 4. Log in as a teacher on the LTI consumer site. Visit the course and click on the 'course' LTI activity. Ensure you are restricted to perform actions only a teacher would be able to in the course. Test 5 - Grade synchronisation task. On your LTI provider site Unenrol all users from the course in your LTI provider. Visit 'Site administration > Server > Scheduled tasks'. Change the 'sync_grades' task so that it runs every minute. On your LTI consumer site Log in as a student and visit the course. Click on 'Assignment LTI'. Add a submission. On your LTI provider site Go to the course as a teacher (or admin). Grade the submission 80/100. Run the cron. On your LTI consumer site As the student view the gradebook and check that you have the grade 80/100. On your LTI provider site Grade the submission again but this time give it 90/100. Make sure you have waited more than a minute. Run the cron again. On your LTI consumer site As the student view the gradebook and check that you have the grade 90/100. On your LTI provider site Make sure you have waited more than a minute. Run the cron again. Check that there is a message saying the grades were not synced due to the grades being the same. On your LTI consumer site As the student view the gradebook and check that you still have the grade 90/100. On your LTI provider site Visit 'Site administration > Plugins > Authentication > Manage authentication'. Disabled the LTI plugin. Make sure you have waited more than a minute. Run the cron again. Check that there is a message saying the authentication plugin is disabled and task has been skipped. Visit 'Site administration > Plugins > Authentication > Manage authentication'. Enable the LTI plugin.

      https://moodle.org/plugins/view/local_ltiprovider

      Martin is interested in having support for sharing courses via LTI.
      He has requested me to take a look to integrate the LTI Provider plugin into Moodle 3.1

      Initially we will support only LTI 1.1 (with the outcomes and membership service)

      The LTI Provider plugin is a local add-on with some hacks (sharing of activities, force navigation, custom CSS) that maybe are not suitable for Moodle core, I'll do a full review of the plugin features to create a spec.

      This should be shipped with core Moodle - we should review the plugin in the plugins DB, identify anything that needs fixing - and fix it (in this issue). Will need to move it out from local

      From Juan,

      The plugin uses some hacks that in my opinion are not suitable for core so I think that maybe an initial approach would be to create a new enrolment plugin "LTI" for sharing courses. Activity sharing would require much more job.

      Todo

      • Create authentication plugin (In progress)
      • Create enrol plugin
      • Create LTI role, setup permissions so they can only do stuff in course
      • Fix debugging errors
        • textlib > core_text (done by aspark)
        • local_ltiprovider_extends to local_ltiprovider_extend (done by aspark)
        • $plugin >component (done by aspark)
        • get_list_of_timezones (done by mjsamberg)
        • Notice: Undefined index: custom_resource_link_description in /home/moodle/moodles/stable_master/moodle/local/ltiprovider/tool.php on line 325
      • Move out from local/
      • Add events (if necessary)
      • Option to enable "allowframembedding" when you activate the provider
      • Don't modify _GET and _POST. Instead, store them in a new variable (best practice) Perhaps there is a way to use moodle library functions as well, but I doubt it. CIBot will just have to complain about this one
      • Fix bug where if you click the link to LTI provider in course settings from an activity module, it will go to the wrong course id
      • Add consumer key, rather than just using the same thing as the shared secret - security concern
      • Check github issues and pull requests. Pull in anything that is ready. Create issues & branches for any needing more work
      • Make sure page titles are set and the headers are included, pagetypes are correct, urls set navigation tree is correct, breadcrumbs show etc
      • Fix coding style problems
      • Remove elements from navigation that the user doesn't need (nav block, user menu)
      • Look into using capabilities rather than rolesallowedcreatecontexts and rolesallowedcreateresources
      • Fix bug where if you log in as admin on your site, you can edit settings to the module on provider's moodle (might be the username is 'admin' and so it appears in $CFG->admin)
      • If the user has an invalid email address, it will constantly try to redirect them to the course, then back to their profile edit page, then back again. We may need a fix for this or similar situations. (There's already a fix for site policy, perhaps we can do similar fixes for other problems)
      • Throw exception if you try to access the site outside of LTI.
      • The plugin asks you to turn on the setting 'Allow frame embedding' which we state in core is 'not recommended for security reasons'. I can see this worrying users - need to think about a better approach without scaring people.
      • Remove upgrade path.
      • Look at all the TODOs in code.
      • Remove usage of deprecated functions.
      • Make sure all strings are being used, remove any that are not.
      • Remove test folder.
      • Fix incompatibility with MNet (see comments below)

            markn Mark Nelson
            jleyva Juan Leyva
            Adrian Greeve Adrian Greeve
            Dan Poltawski Dan Poltawski
            Frédéric Massart Frédéric Massart
            Votes:
            3 Vote for this issue
            Watchers:
            18 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.