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

LTI Adv: external tool add may fail due to uniqueness constraint

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      Prerequisite

      Note: This test is using 2 apps to test 1.3 and 1.1 interactions; any other LTI 1.3 Test application could be used instead. Steps should be rather identical, what matters is to be able to post 2 resources with the same resource id and a tag value, both under 1.1 and 1.3 flows.

      1. Site is configured with at least one course
      2. LTI Test tool 1.1 is installed as a site external tool:
        1. Log in as an administrator
        2. Navigate to Site Administration > Plugins > External tool > Manage tools
        3. Click on configure a tool manually
        4. Fill the form as follow:
          1. Tool name: LTI Test Tool
          2. Tool url: https://lti.tools/test/tp.php
        5. Consumer key: any value would do
        6. Shared secret: secret
        7. Click on ‘Show more’
        8. Check Content-Item message
        9. Change the 'Privacy' setting ‘Accept grades from the tool’ to 'Delegate to Teacher'.
        10. In Services, IMS LTI Assignment and Grade Services, choose Use this service for grade and column mgmt
        11. Save changes.
      3. ZTest tool 1.3 is installed as a site external tool:
        1. Log in as an administrator
        2. Navigate to Site Administration > Plugins > External tool > Manage tools
        3. Click on configure a tool manually
        4. Fill the form as follow:
          1. Tool name: ZTest 1.3
          2. Tool url: https://ztest.cengage.info/ztest/lti
        5. LTI Version: LTI 1.3
        6. Public key: copy the value from https://ztest.cengage.info/ztest/ LTI 1.3 Connect info tab
        7. Initiate Login URI: https://ztest.cengage.info/ztest/ws/lti/startlaunch?lti13=true&client_id=CLIENT_ID_HERE&platform=moodle
        8. Redirect URI: https://ztest.cengage.info/ztest/lti
        9. Click on ‘Show more’
        10. Check Content-Item message
        11. Change the 'Privacy' setting ‘Accept grades from the tool’ to 'Delegate to Teacher'.
        12. In Services, IMS LTI Assignment and Grade Services, choose Use this service for grade and column mgmt
        13. Save changes.
        14. Once the tool is created, click the information icon (pie icon) and copy the client id
        15. Update the initiate login URI and replace CLIENT_ID_HERE with the client id value for that tool
      Adding an LTI 1.1 Resource link with line item creates a graded activity and persists resource id and tag

      In this test we verify that when an app is configured to set or not a gradebook column on a per link bases, a gradebook column will always be enabled and populated only if the content item contains a gradebook column, and that the resource id and tag are persisted.

      1. As instructor, log to a course
      2. Turn editing ON
      3. Click Add an activity or resource and select external tool
      4. On the Add external tool page, select LTI Test tool for preconfigured tool
      5. Click on Select Content
      6. In the modal:
        1. Click content-item button
      7. Click on Select Content
      8. In the modal:
        1. Click content-item button
        2. Select LTI Launch 2 (it contains a gradebook definition)
        3. At the bottom of the page, click return selection
      9. When the modal is closed, verify:
        1. Grade section is visible
        2. Expand the grade section
        3. Maximum Score: 50
        4. Verify id-number has no value
        5. Save and return to course
        6. Launch the link
        7. In the raw parameters check custom_lineitem_url is present and populated
        8. Select outcomes 2 and line item, click action: read
        9. In the pop-up verify the JSON contains a property "resourceId" with a value of "a-...." (starts with a--)
      Adding an LTI 1.3 Resource link with line item creates a graded activity and persists resource id and tag

      In this test we verify that when an app is configured to set or not a gradebook column on a per link bases, a gradebook column will always be enabled and populated only if the content item contains a gradebook column, and that the resource id and tag are persisted.

      1. As instructor, log to a course
      2. Turn editing ON
      3. Click Add an activity or resource and select external tool
      4. On the Add external tool page, select ZTest 13 tool for preconfigured tool
      5. Click on Select Content
      6. In the modal:
        1. Click content-item button
      7. Click on Select Content
      8. In the modal:
        1. Click on pie icon and select content-item
        2. Enter for the resource id: MDL-65306-ZTest
        3. Select Assignment and set points possible to 50
        4. Click Submit button
      9. When the modal is closed, verify:
        1. Grade section is visible
        2. Expand the grade section
        3. Maximum Score: 50
        4. Verify id-number has no value
        5. Save and return to course
        6. Launch the ztest activity link just created
        7. In the parameters check custom_lineitem_url is present and populated
        8. Select Any call
        9. Click on Get line items and Send buttons
        10. In the Response, verify 200 and that there is one (and only one) item present with "resourceId": "MDL-65306-Ztest"
        11. The same json object should also have the property: "tag": "ztest-tag"
      Verify we can have more than one link with the same resource id and tag
      1. We now repeat the above operation (Adding an LTI 1.3 Resource link) exactly so as to create a duplicate
      2. Only change the final verification after Get Line Items in Ztest:
        1. In the Response, verify 200 and that there are 2 items present with "resourceId": "MDL-65306-Ztest"
        2. The same json object should also have the property: "tag": "ztest-tag"
      Show
      Prerequisite Note: This test is using 2 apps to test 1.3 and 1.1 interactions; any other LTI 1.3 Test application could be used instead. Steps should be rather identical, what matters is to be able to post 2 resources with the same resource id and a tag value, both under 1.1 and 1.3 flows. Site is configured with at least one course LTI Test tool 1.1 is installed as a site external tool: Log in as an administrator Navigate to Site Administration > Plugins > External tool > Manage tools Click on configure a tool manually Fill the form as follow: Tool name: LTI Test Tool Tool url: https://lti.tools/test/tp.php Consumer key: any value would do Shared secret: secret Click on ‘Show more’ Check Content-Item message Change the 'Privacy' setting ‘Accept grades from the tool’ to 'Delegate to Teacher'. In Services, IMS LTI Assignment and Grade Services, choose Use this service for grade and column mgmt Save changes. ZTest tool 1.3 is installed as a site external tool: Log in as an administrator Navigate to Site Administration > Plugins > External tool > Manage tools Click on configure a tool manually Fill the form as follow: Tool name: ZTest 1.3 Tool url: https://ztest.cengage.info/ztest/lti LTI Version: LTI 1.3 Public key: copy the value from https://ztest.cengage.info/ztest/ LTI 1.3 Connect info tab Initiate Login URI: https://ztest.cengage.info/ztest/ws/lti/startlaunch?lti13=true&client_id=CLIENT_ID_HERE&platform=moodle Redirect URI: https://ztest.cengage.info/ztest/lti Click on ‘Show more’ Check Content-Item message Change the 'Privacy' setting ‘Accept grades from the tool’ to 'Delegate to Teacher'. In Services, IMS LTI Assignment and Grade Services, choose Use this service for grade and column mgmt Save changes. Once the tool is created, click the information icon (pie icon) and copy the client id Update the initiate login URI and replace CLIENT_ID_HERE with the client id value for that tool Adding an LTI 1.1 Resource link with line item creates a graded activity and persists resource id and tag In this test we verify that when an app is configured to set or not a gradebook column on a per link bases, a gradebook column will always be enabled and populated only if the content item contains a gradebook column, and that the resource id and tag are persisted. As instructor, log to a course Turn editing ON Click Add an activity or resource and select external tool On the Add external tool page, select LTI Test tool for preconfigured tool Click on Select Content In the modal: Click content-item button Click on Select Content In the modal: Click content-item button Select LTI Launch 2 (it contains a gradebook definition) At the bottom of the page, click return selection When the modal is closed, verify: Grade section is visible Expand the grade section Maximum Score: 50 Verify id-number has no value Save and return to course Launch the link In the raw parameters check custom_lineitem_url is present and populated Select outcomes 2 and line item, click action: read In the pop-up verify the JSON contains a property "resourceId" with a value of "a-...." (starts with a--) Adding an LTI 1.3 Resource link with line item creates a graded activity and persists resource id and tag In this test we verify that when an app is configured to set or not a gradebook column on a per link bases, a gradebook column will always be enabled and populated only if the content item contains a gradebook column, and that the resource id and tag are persisted. As instructor, log to a course Turn editing ON Click Add an activity or resource and select external tool On the Add external tool page, select ZTest 13 tool for preconfigured tool Click on Select Content In the modal: Click content-item button Click on Select Content In the modal: Click on pie icon and select content-item Enter for the resource id: MDL-65306 -ZTest Select Assignment and set points possible to 50 Click Submit button When the modal is closed, verify: Grade section is visible Expand the grade section Maximum Score: 50 Verify id-number has no value Save and return to course Launch the ztest activity link just created In the parameters check custom_lineitem_url is present and populated Select Any call Click on Get line items and Send buttons In the Response, verify 200 and that there is one (and only one) item present with "resourceId": " MDL-65306 -Ztest" The same json object should also have the property: "tag": "ztest-tag" Verify we can have more than one link with the same resource id and tag We now repeat the above operation (Adding an LTI 1.3 Resource link) exactly so as to create a duplicate Only change the final verification after Get Line Items in Ztest: In the Response, verify 200 and that there are 2 items present with "resourceId": " MDL-65306 -Ztest" The same json object should also have the property: "tag": "ztest-tag"
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-65306-resourceid

      Description

      Part of the LTI Advantage Assignment and Grade Services support, Moodle must retain for each grade item created for LTI the resource id and the tag as provided by the tool when the line item was created. Currently the resource id is stored using the grade item id number; as a consequence:

      1. The link may fail creation due to a uniqueness constraint on the id number field used to store the resource id
      2. The id number may be edited by the end user which would cause the tool to possibly malfunction

      The proposed fix is:

      1. Add a new column in gbs table to store resource id and use it to store the resource id
      2. Migrates existing id_number to gbs.resource_id
        1. This will require the addition of the missing gbs entries
      3. Modify the add activity flow to pass both the resource_id as hidden input to the back end and have the back end create the associated gbs entry

      The last step is similar to the work done for MDL-65305 about how tag are stored as part of the external tool add/edit flow.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                claudevervoort Claude Vervoort
                Reporter:
                claudevervoort Claude Vervoort
                Participants:
                Component watchers:
                Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: