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

LTI Advantage: LineItems are removed by CRON job



    • MDL-64357_master
    • Hide

      Until this is fixed, a moodle instance should disable the LTI Assignment and Grade Services table cleanup task (using the moodle admin interface)

      Until this is fixed, a moodle instance should disable the LTI Assignment and Grade Services table cleanup task (using the moodle admin interface)
    • Hide

      Covered by unit tests.

      Covered by unit tests.


      LineItems created using the Assignment and Grade Services are removed after a few hours due to a bug in the clean-up task. As a result, grade sync is no longer functional and items have to re-created, only to be removed again a few hours down.
      When deploying a tool (site or course), a tool can be configured to have access to LTI services membership and assignment and grade services (AGS).

      For the tests below, a test tool named ZTest will be used. The tool is available at https://ztest.cengage.info/ztest/


      Add test tool
      1. Site is configured with at least one course
      2. Assign a user (instructor) to the manager role site-wide
      Configure a site tool without access to AGS
      1. Log in as an administrator
      2. Navigate to Site Administration > Plugins > Manage tools
      3. Click on configure a tool manually
      4. Fill the form as follow:
        1. Tool name: ZTest
        2. Tool url: https://ztest.cengage.info/ztest/lti11
        3. Consumer key: moodle-testing
        4. Shared secret: ztest-secret
        5. In the Services section, set the Assignment and Grades service to: ‘use this service for grade sync and column management’
      5. Confirm tool is saved successfully
      Add a ZTest link to the course
      1. Log in as instructor
      2. Navigate to course
      3. Turn editing ON
      4. Click Add an activity or resource and select external tool
      5. On the Add external tool page, select ZTest for preconfigured tool
      6. Activity Name: ZTest Assignment
      7. Save and verify the course is successfully added to the course

      Reproducing the issue:

      We'll verify that added lineitems disappear when the scheduled task is run when they should be preserved.

      1. As instructor enter the Course
      2. Launch the ZTest Link created above
      3. Check the ZTest app displays all the parameters it received, locate the one that is named custom_lineitems_url (notice the s) and copy the value (a URL)
      4. In ZTest switch to the tab named AnyCall and
        1. In URL paste the value of custom_lineitems_url
        2. In method select POST (You may need to delete the word 'GET' from the field, and use arrow to then select POST)
        3. In the content type, choose application/vnd.ims.lis.v2.lineitem+json
        4. A payload is automatically generated in the payload textarea, note the resourceId value
        5. Press Send!
        6. Verify a 200 response (meaning a new gradebook column has been created!)
        7. Now let's use the API to get the lineitems owned by ZTest by:
          1. change the method to GET
          2. change the content type to application/vnd.ims.lis.v2.lineitemcontainer+json
          3. Press Send!
          4. Verify in the repsonse section we find back our lineitem just created above (by looking at resourceId)
        8. In another browser
          1. log as admin
          2. Navigate to Site Administration > Server > Scheduled Task
          3. Locate the task LTI Assignment and Grade Services table cleanup
          4. click on run it now, and confirm
        9. Go back to the 1st browser where ZTest is loaded
          1. Press Send! to get once again the line items associated with ZTest
          2. Verify: the lineitem created in the beginning of this test is no more listed
            1. Expected: the lineitem must not be removed when the scheduled task is run




            claudevervoort Claude Vervoort
            claudevervoort Claude Vervoort
            Mark Nelson Mark Nelson
            Jake Dallimore Jake Dallimore
            CiBoT CiBoT
            0 Vote for this issue
            3 Start watching this issue