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

Enhance the processing of the content item return in the core_ltix Deep linking API

XMLWordPrintable

    • MDL-83958-main-1
    • Hide

      LTI 1.3 Deep-linking

      1. Create two Moodle sites running on localhost - one designated 'platform', one 'tool'.
      2. In both sites, go to admin settings and clear all values from the 'curlsecurityblockedhosts' admin setting and save.
      3. In the platform site, create a course called "Platform course" and enrol a teacher.
      4. In the tool site, create a course called "Tool course", with:
        • An assignment called "Assign 1" with a max grade of 80.
        • An assignment called "Assign 2" using the default settings.
        • A file resource (representing a non-graded activity).
        • A teacher enrolled.
      5. In the tool site admin settings:
        • Enable enrol_lti and auth_lti plugins.
        • Enable "Allow frame embedding".
      6. On the tool site, go to Admin > Plugins > Enrolments > Publish as LTI tool > Tool registration.
      7. Click 'Register a platform', enter a name for the platform and click "Continue".
      8. Once the platform is registered, keep this page with the registration details open; we'll need it shortly.
      9. On the platform site, go to 'Admin > General > LTI > Manage tools'.
      10. In the 'Add tool' section, paste the dynamic registration URL from the registration details on the tool site and click 'Add LTI Advantage'.
      11. Once the tool is created, click on 'Activate'.
      12. Now, go to the 'Platform course' course and select 'LTI external tools' from the secondary navigation.
      13. Enable 'Show in activity chooser' for the tool.
      14. Log out of both the platform and tool sites completely.
      15. On the platform site, log in as the teacher.
      16. Go to the "Platform course" course.
      17. Click to add a new activity, selecting the Tool.
      18. When the edit page loads, click the "Select content" button.
      19. You should be asked to link your tool account.
      20. Proceed to link your account by clicking the "Link this account" button.
      21. Verify you see "No resources or activities are published yet" in the modal. (We'll need to publish some resources first)
      22. Go to the tool site's course 'Tool course'.
      23. From the menu, select "Published as LTI Tools"
      24. In the "LTI Advantage" tab, click "Add".
      25. Enter the following values:
        • Set "Tool to be published" to "Assign 1".
        • Save.
      26. Repeat steps 22-25, and this time publish 'Assign 2' and the file resource.
      27. Now, go back to the platform site and again, click "Select content".
      28. Verify:
        • You can see 'Assign 1', 'Assign 2', and the file resource listed under its parent course.
        • You can see both "Add to course" and "Add to gradebook" checkboxes next to "Assign 1" and "Assign 2".
        • You can only see the "Add to course" checkbox for the file resource.
        • You DO NOT see any checkboxes for the course row itself.
      29. Make sure no checkboxes are selected and click "Add content".
      30. Verify that the modal closes and no errors are shown.
      31. Click "Select content" again.
      32. Make sure both checkboxes for "Assign 1" are checked this time
      33. Click "Add content".
      34. Verify you see (you may need to click "Show more" to see this option):
        • The mod edit form has been updated, with the name set to "Assign 1" now
        • That 'Custom parameters' contains a value like 'id=some-uuid-value-here'
        • The grade has been set to "Point" with "Maxgrade" set to 80, as per the resource's settings in the tool
        • That 'Allow {tool} to add grades in the gradebook' is checked.
      35. Click "Save and return to course"
      36. Verify that the "Assign 1" activity has been successfully added to the "Platform course" course
      37. Open the "Assign 1" activity.
      38. Verify you can see the assignment from the tool site as an embedded iframe on your platform site.
      39. Go to the settings page of "Assign 1" activity
      40. Verify that there is an indicator that the content is already selected.
      41. Click "Select content"
      42. Make sure both checkboxes for "Assign 2" are checked this time
      43. Click "Add content"
      44. Verify you see (you may need to click "Show more" to see this option):
        • The mod edit form has been updated, with the name set to "Assign 2" now.
        • That 'Custom parameters' contains a value like 'id=some-uuid-value-here'
        • The grade has been set to "Point" with "Maxgrade" set to 100, as per the resource's settings in the tool
        • That 'Allow {tool} to add grades in the gradebook is checked.
      45. Click "Save and return to course".
      46. Verify that the "Assign 2" activity has been successfully added to the "Platform course" course
      47. Open the "Assign 2" activity.
      48. Verify you can see the assignment in the tool site as an embedded iframe on your platform site.
      49. Now go back to the "Platform course" and add a new Tool activity.
      50. Click "Select content".
      51. Make sure both checkboxes for "Assign 1" are checked and the "Add to course" checkbox for the file resource
      52. Click "Add content".
      53. Verify you see a page that shows a list of items ("Assign 1" and the file resource) that will be added to the course.
      54. Click "Save and return to course".
      55. Verify:
        • Both "Assign 1" and the file resources have been added to the course.
        • Both are displayed as an embedded iframe in your platform site.
        • The relevant settings have been preserved (e.g Grade settings for the assignment)

       

      LTI 1.0/1.1 Deep-linking (proceed from the previous test)

      For testing purposes, we could use the saLTIre testing system for LTI.

      1. Log in as an admin.
      2. On the platform site, go to 'Admin > General > LTI > Manage tools'.
      3. In the 'Add tool' section, click on 'configure a tool manually'.
      4. On the tool configuration page, set:
        • 'Tool name' = 'LTI 1.0 tool'
        • 'Tool URL' = 'https://saltire.lti.app/tool'
        • 'LTI version' = 'LTI 1.0/1.1'
        • 'Consumer key' = 'jisc.ac.uk'
        • 'Shared secret' = 'secret' 
        • Enable 'Supports Deep Linking (Content-Item Message)'
      5. Save the changes to create the new tool and then verify that the tool has been created and activated.
      6. Now, go to the 'Platform course' course and select 'LTI external tools' from the secondary navigation.
      7. Enable 'Show in activity chooser' for the newly created 'LTI 1.0 tool'.
      8. Now log in as a teacher on the platform site.
      9. Go to the "Platform course" course.
      10. Click to add a new activity, selecting the 'LTI 1.0 tool'.
      11. When the edit page loads, click the "Select content" button.
      12. Verify that you can see the interface provided through the saLTIre tool in the content selection modal.
      13. Click on 'Sample content' from the top menu.
      14. Then check 'LTI launch - a link to launch this tool' (make sure you don't check any other options).
      15. Scroll down and press 'Return selection'.
      16. Verify that the modal closes and no errors are shown.
      17. Verify you see (you may need to click "Show more" to see this option):
        • An indication that content has been selected.
        • The mod edit form has been updated, with the name set to "LTI 1.1 tool" now
        • That 'Custom parameters' contains values like 'Person.name.fufullname=$ll', etc.
        • That 'Allow {tool} to add grades in the gradebook' is unchecked, and there are no other grade options available.
      18. Change the name of the activity to 'LTI 1.1 tool resource - non-gradable'.
      19. Click "Save and return to course"
      20. Verify that the "LTI 1.1 tool resource - non-gradable" activity has been successfully added to the "Platform course" course.
      21. Open the "LTI 1.1 tool resource - non-gradable" activity.
      22. Verify you can see the saLTIre tool as an embedded iframe on your platform site.
      23. Create a new LTI 1.1 tool activity by repeating the same steps (10-13).
      24. This time, check 'LTI launch 2 - a link to launch this tool with an associated gradebook column' (make sure you don't check any other options)
      25. Scroll down and press 'Return selection'.
      26. Verify you see (you may need to click "Show more" to see this option):
        • An indication that content has been selected.
        • The mod edit form has been updated, with the name set to "LTI 1.1 tool" now
        • That 'Custom parameters' contains values like 'Person.name.fufullname=$ll', etc.
        • That 'Allow {tool} to add grades in the gradebook' is checked
        • The grade has been set to "Point" with "Maxgrade" set to 50, as per the resource's settings in the tool
      27. Change the name to 'LTI 1.1 tool resource - gradable'.
      28. Click "Save and return to course"
      29. Verify that the "LTI 1.1 tool resource - gradable" activity has been successfully added to the "Platform course" course.
      30. Open the "LTI 1.1 tool resource - gradable" activity.
      31. Verify you can see the saLTIre tool, as an embedded iframe in your platform site.
      32. Create another LTI 1.1 tool activity by repeating the same steps (10-13).
      33. This time, check multiple different options. Example:
        • LTI launch (with launch URL) - a link to launch this tool
        • LTI launch 2 (with launch URL) - a link to launch this tool with an associated gradebook column
        • LTI launch 3 - a link to launch a different tool
      34. Scroll down and press 'Return selection'.
      35. Verify that you see a page that shows a list of items (the selected resources earlier) that will be added to the course.
      36. Click "Save and return to course".
      37. Verify:
        • All resources have been added as separate activities to the course
        • All are displayed as an embedded iframe in your platform site.
        • The relevant settings have been preserved (e.g. Grade settings, etc.)
      Show
      LTI 1.3 Deep-linking Create two Moodle sites running on localhost - one designated 'platform', one 'tool'. In both sites, go to admin settings and clear all values from the 'curlsecurityblockedhosts' admin setting and save. In the platform site, create a course called "Platform course" and enrol a teacher. In the tool site, create a course called "Tool course", with: An assignment called "Assign 1" with a max grade of 80. An assignment called "Assign 2" using the default settings. A file resource (representing a non-graded activity). A teacher enrolled. In the tool site admin settings: Enable enrol_lti and auth_lti plugins. Enable "Allow frame embedding". On the tool site, go to Admin > Plugins > Enrolments > Publish as LTI tool > Tool registration. Click 'Register a platform', enter a name for the platform and click "Continue". Once the platform is registered, keep this page with the registration details open; we'll need it shortly. On the platform site, go to 'Admin > General > LTI > Manage tools'. In the 'Add tool' section, paste the dynamic registration URL from the registration details on the tool site and click 'Add LTI Advantage'. Once the tool is created, click on 'Activate'. Now, go to the 'Platform course' course and select 'LTI external tools' from the secondary navigation. Enable 'Show in activity chooser' for the tool. Log out of both the platform and tool sites completely. On the platform site, log in as the teacher. Go to the "Platform course" course. Click to add a new activity, selecting the Tool. When the edit page loads, click the "Select content" button. You should be asked to link your tool account. Proceed to link your account by clicking the "Link this account" button. Verify you see "No resources or activities are published yet" in the modal. (We'll need to publish some resources first) Go to the tool site's course 'Tool course'. From the menu, select "Published as LTI Tools" In the "LTI Advantage" tab, click "Add". Enter the following values: Set "Tool to be published" to "Assign 1". Save. Repeat steps 22-25, and this time publish 'Assign 2' and the file resource. Now, go back to the platform site and again, click "Select content". Verify : You can see 'Assign 1', 'Assign 2', and the file resource listed under its parent course. You can see both "Add to course" and "Add to gradebook" checkboxes next to "Assign 1" and "Assign 2". You can only see the "Add to course" checkbox for the file resource. You DO NOT see any checkboxes for the course row itself. Make sure no checkboxes are selected and click "Add content". Verify that the modal closes and no errors are shown. Click "Select content" again. Make sure both checkboxes for "Assign 1" are checked this time Click "Add content". Verify you see (you may need to click "Show more" to see this option): The mod edit form has been updated, with the name set to "Assign 1" now That 'Custom parameters' contains a value like 'id=some-uuid-value-here' The grade has been set to "Point" with "Maxgrade" set to 80, as per the resource's settings in the tool That 'Allow {tool} to add grades in the gradebook' is checked. Click "Save and return to course" Verify that the "Assign 1" activity has been successfully added to the "Platform course" course Open the "Assign 1" activity. Verify you can see the assignment from the tool site as an embedded iframe on your platform site. Go to the settings page of "Assign 1" activity Verify that there is an indicator that the content is already selected. Click "Select content" Make sure both checkboxes for "Assign 2" are checked this time Click "Add content" Verify you see (you may need to click "Show more" to see this option): The mod edit form has been updated, with the name set to "Assign 2" now. That 'Custom parameters' contains a value like 'id=some-uuid-value-here' The grade has been set to "Point" with "Maxgrade" set to 100, as per the resource's settings in the tool That 'Allow {tool} to add grades in the gradebook is checked. Click "Save and return to course". Verify that the "Assign 2" activity has been successfully added to the "Platform course" course Open the "Assign 2" activity. Verify you can see the assignment in the tool site as an embedded iframe on your platform site. Now go back to the "Platform course" and add a new Tool activity. Click "Select content". Make sure both checkboxes for "Assign 1" are checked and the "Add to course" checkbox for the file resource Click "Add content". Verify you see a page that shows a list of items ("Assign 1" and the file resource) that will be added to the course. Click "Save and return to course". Verify: Both "Assign 1" and the file resources have been added to the course. Both are displayed as an embedded iframe in your platform site. The relevant settings have been preserved (e.g Grade settings for the assignment)   LTI 1.0/1.1 Deep-linking (proceed from the previous test) For testing purposes, we could use the saLTIre testing system for LTI. Log in as an admin. On the platform site, go to 'Admin > General > LTI > Manage tools'. In the 'Add tool' section, click on 'configure a tool manually'. On the tool configuration page, set: 'Tool name' = 'LTI 1.0 tool' 'Tool URL' = ' https://saltire.lti.app/tool ' 'LTI version' = 'LTI 1.0/1.1' 'Consumer key' = 'jisc.ac.uk' 'Shared secret' = 'secret'  Enable 'Supports Deep Linking (Content-Item Message)' Save the changes to create the new tool and then verify that the tool has been created and activated. Now, go to the 'Platform course' course and select 'LTI external tools' from the secondary navigation. Enable 'Show in activity chooser' for the newly created 'LTI 1.0 tool'. Now log in as a teacher on the platform site. Go to the "Platform course" course. Click to add a new activity, selecting the 'LTI 1.0 tool'. When the edit page loads, click the "Select content" button. Verify that you can see the interface provided through the saLTIre tool in the content selection modal. Click on 'Sample content' from the top menu. Then check 'LTI launch - a link to launch this tool' (make sure you don't check any other options). Scroll down and press 'Return selection'. Verify that the modal closes and no errors are shown. Verify you see (you may need to click "Show more" to see this option): An indication that content has been selected. The mod edit form has been updated, with the name set to "LTI 1.1 tool" now That 'Custom parameters' contains values like 'Person.name.fufullname=$ll', etc. That 'Allow {tool} to add grades in the gradebook' is unchecked, and there are no other grade options available. Change the name of the activity to 'LTI 1.1 tool resource - non-gradable'. Click "Save and return to course" Verify that the "LTI 1.1 tool resource - non-gradable" activity has been successfully added to the "Platform course" course. Open the "LTI 1.1 tool resource - non-gradable" activity. Verify you can see the saLTIre tool as an embedded iframe on your platform site. Create a new LTI 1.1 tool activity by repeating the same steps (10-13). This time, check 'LTI launch 2 - a link to launch this tool with an associated gradebook column' (make sure you don't check any other options) Scroll down and press 'Return selection'. Verify you see (you may need to click "Show more" to see this option): An indication that content has been selected. The mod edit form has been updated, with the name set to "LTI 1.1 tool" now That 'Custom parameters' contains values like 'Person.name.fufullname=$ll', etc. That 'Allow {tool} to add grades in the gradebook' is checked The grade has been set to "Point" with "Maxgrade" set to 50, as per the resource's settings in the tool Change the name to 'LTI 1.1 tool resource - gradable'. Click "Save and return to course" Verify that the "LTI 1.1 tool resource - gradable" activity has been successfully added to the "Platform course" course. Open the "LTI 1.1 tool resource - gradable" activity. Verify you can see the saLTIre tool, as an embedded iframe in your platform site. Create another LTI 1.1 tool activity by repeating the same steps (10-13). This time, check multiple different options. Example: LTI launch (with launch URL) - a link to launch this tool LTI launch 2 (with launch URL) - a link to launch this tool with an associated gradebook column LTI launch 3 - a link to launch a different tool Scroll down and press 'Return selection'. Verify that you see a page that shows a list of items (the selected resources earlier) that will be added to the course. Click "Save and return to course". Verify: All resources have been added as separate activities to the course All are displayed as an embedded iframe in your platform site. The relevant settings have been preserved (e.g. Grade settings, etc.)
    • Hide

      Fails against automated checks.

      Checked MDL-83958 using repository: https://github.com/mihailges/moodle.git

      Should these errors be fixed?

      Built on: Mon Mar 31 14:45:36 UTC 2025

      Show
      Fails against automated checks. Checked MDL-83958 using repository: https://github.com/mihailges/moodle.git main [branch: MDL-83958-main | CI Job ] Warn: The MDL-83958 -main branch at https://github.com/mihailges/moodle.git has not been rebased recently (>20 days ago). Error: The MDL-83958 -main branch at https://github.com/mihailges/moodle.git does not apply clean to origin/main Error: Merge conflict(s) in file(s): Error: lib/db/upgrade.php Error: mod/lti/lang/en/lti.php Error: mod/lti/locallib.php Error: theme/boost/scss/moodle.scss Error: theme/boost/style/moodle.css Error: theme/classic/style/moodle.css Error: version.php Should these errors be fixed? Built on: Mon Mar 31 14:45:36 UTC 2025
    • 5
    • Team Alpha - Sprint 2 I1-2025, Team Alpha - Sprint 3 I1-2025, Team Alpha - Sprint 4 I1-2025

      MDL-82919 introduces a core Deep Linking API that enables API consumers to define custom logic for processing content item return data by extending the core_ltix/contentitem module and implementing the processContentItemReturnData() function. This flexibility allows tailored handling of content items to suit specific use cases.

      However, the current implementation remains partially coupled to the legacy mod_lti use case. This dependency stems from backend pre-processing of the return data within core_ltix/helper::content_item_to_form() (called by core_ltix/helper::tool_configuration_from_content_item()), which transforms the content items into form data tailored for mod_lti. While this is currently functional since mod_lti is the sole user of the Deep Linking API, the coupling significantly limits the API's scalability and adaptability for other use cases.

      The objective of this issue is to decouple the Deep Linking API from the legacy mod_lti use case and enhance its flexibility. Specifically, this involves enabling API consumers to receive raw, unprocessed content item return data and providing mechanisms for them to independently handle the data according to their specific requirements.

      Scope:

      • Assessment of current implementation:
        • Identify all dependencies on mod_lti-specific data processing logic, particularly within ltix/contentitem_return.php
      • Evaluation of different solutions
        • Assess the feasibility and effectiveness of introducing hooks as an alternative solution for custom processing.
        • Compare hooks against the current extension-based JS mechanism , considering factors such as ease of use, performance, and scalability.
        • If possible, propose additional alternative solutions to ensure the most robust, flexible, and future-proof implementation for custom data handling
      • Enable fully consumer-based data processing
        • Implement the mechanism for API consumers to process raw content item data independently.

            Geshoski Mihail Geshoski
            Geshoski Mihail Geshoski
            Glyn (Mathew) May Glyn (Mathew) May
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 days, 5 hours, 59 minutes
                4d 5h 59m

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