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

Make sure pagination works in LTI Memberships service

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Major Major
    • 3.0
    • 3.0
    • LTI External tool
    • MOODLE_30_STABLE
    • MOODLE_30_STABLE
    • Hide
      1. Create a tool registration via http://lti.tools/test/tp.php - ensure the Memberships service is offered and accepted
      2. Enable the created tool type on Manage external tool types
      3. Add an instance of the tool to a course
      4. Launch the tool
      5. Click on the Memberships button
      6. Add the parameters (?limit=10&from=1) to the Context query, where the limit is the quantity of users you want get. The query should be similar to:

        http://qa.moodle.net/mod/lti/services.php/CourseSection/5/bindings/celtic-project.org/tdeQgAkvfqbmReC/1/memberships?limit=10&from=1

      7. Click on the Read button
      8. Check the JSON in the response to ensure it correctly reports each user enrolled in the course - also check for a nextPage element and send a request to this endpoint to check that it properly gives the next set of members (only included when the limit option is used).
      9. The response should be similar to this:

        Service responseclose or Esc Key
        HTTP/1.1 200 OK
        Date: Wed, 04 Nov 2015 02:28:06 GMT
        Content-Type: application/vnd.ims.lis.v2.membershipcontainer+json;charset=UTF-8
        Transfer-Encoding: chunked
        Connection: keep-alive
        Set-Cookie: __cfduid=d2d407d161d9b72947cc93b36ced477bc1446604086; expires=Thu, 03-Nov-16 02:28:06 GMT; path=/; domain=.moodle.net; HttpOnly
        Vary: Front-End-Https,Accept-Encoding,User-Agent
        Cache-Control: max-age=3600
        Expires: Wed, 04 Nov 2015 03:28:06 GMT
        Server: cloudflare-nginx
        CF-RAY: 23fce2323a811061-CDG
         
        {
          "@context" : "http://purl.imsglobal.org/ctx/lis/v2/MembershipContainer",
          "@type" : "Page",
          "@id" : "http://qa.moodle.net/mod/lti/services.php/CourseSection/5/bindings/celtic-project.org/tdeQgAkvfqbmReC/1/memberships",
          "nextPage" : "http://qa.moodle.net/mod/lti/services.php/CourseSection/5/bindings/celtic-project.org/tdeQgAkvfqbmReC/1/memberships?limit=10&from=11",
          "pageOf" : {
            "@type" : "LISMembershipContainer",
            "membershipSubject" : {
              "@type" : "Context",
              "contextId" : "5",
              "membership" : [
                {"status":"Active","member":{"userId":"37","sourcedId":"","name":"Student 30","givenName":"Student","familyName":"30","email":"student30@example.com"},"role":["Learner"]},
                {"status":"Active","member":{"userId":"38","sourcedId":"","name":"Student 31","givenName":"Student","familyName":"31","email":"student31@example.com"},"role":["Learner"]},
                {"status":"Active","member":{"userId":"39","sourcedId":"","name":"Student 32","givenName":"Student","familyName":"32","email":"student32@example.com"},"role":["Learner"]},
                {"status":"Active","member":{"userId":"40","sourcedId":"","name":"Student 33","givenName":"Student","familyName":"33","email":"student33@example.com"},"role":["Learner"]},
                {"status":"Active","member":{"userId":"41","sourcedId":"","name":"Student 34","givenName":"Student","familyName":"34","email":"student34@example.com"},"role":["Learner"]},
                {"status":"Active","member":{"userId":"42","sourcedId":"","name":"Student 35","givenName":"Student","familyName":"35","email":"student35@example.com"},"role":["Learner"]},
                {"status":"Active","member":{"userId":"43","sourcedId":"","name":"Student 36","givenName":"Student","familyName":"36","email":"student36@example.com"},"role":["Learner"]},
                {"status":"Active","member":{"userId":"44","sourcedId":"","name":"Student 37","givenName":"Student","familyName":"37","email":"student37@example.com"},"role":["Learner"]},
                {"status":"Active","member":{"userId":"45","sourcedId":"","name":"Student 38","givenName":"Student","familyName":"38","email":"student38@example.com"},"role":["Learner"]},
                {"status":"Active","member":{"userId":"46","sourcedId":"","name":"Student 39","givenName":"Student","familyName":"39","email":"student39@example.com"},"role":["Learner"]}
              ]
            }
          }
        }
        

      Show
      Create a tool registration via http://lti.tools/test/tp.php - ensure the Memberships service is offered and accepted Enable the created tool type on Manage external tool types Add an instance of the tool to a course Launch the tool Click on the Memberships button Add the parameters (?limit=10&from=1) to the Context query, where the limit is the quantity of users you want get. The query should be similar to: http://qa.moodle.net/mod/lti/services.php/CourseSection/5/bindings/celtic-project.org/tdeQgAkvfqbmReC/1/memberships?limit=10&from=1 Click on the Read button Check the JSON in the response to ensure it correctly reports each user enrolled in the course - also check for a nextPage element and send a request to this endpoint to check that it properly gives the next set of members (only included when the limit option is used). The response should be similar to this: Service responseclose or Esc Key HTTP/1.1 200 OK Date: Wed, 04 Nov 2015 02:28:06 GMT Content-Type: application/vnd.ims.lis.v2.membershipcontainer+json;charset=UTF-8 Transfer-Encoding: chunked Connection: keep-alive Set-Cookie: __cfduid=d2d407d161d9b72947cc93b36ced477bc1446604086; expires=Thu, 03-Nov-16 02:28:06 GMT; path=/; domain=.moodle.net; HttpOnly Vary: Front-End-Https,Accept-Encoding,User-Agent Cache-Control: max-age=3600 Expires: Wed, 04 Nov 2015 03:28:06 GMT Server: cloudflare-nginx CF-RAY: 23fce2323a811061-CDG   { "@context" : "http://purl.imsglobal.org/ctx/lis/v2/MembershipContainer", "@type" : "Page", "@id" : "http://qa.moodle.net/mod/lti/services.php/CourseSection/5/bindings/celtic-project.org/tdeQgAkvfqbmReC/1/memberships", "nextPage" : "http://qa.moodle.net/mod/lti/services.php/CourseSection/5/bindings/celtic-project.org/tdeQgAkvfqbmReC/1/memberships?limit=10&from=11", "pageOf" : { "@type" : "LISMembershipContainer", "membershipSubject" : { "@type" : "Context", "contextId" : "5", "membership" : [ {"status":"Active","member":{"userId":"37","sourcedId":"","name":"Student 30","givenName":"Student","familyName":"30","email":"student30@example.com"},"role":["Learner"]}, {"status":"Active","member":{"userId":"38","sourcedId":"","name":"Student 31","givenName":"Student","familyName":"31","email":"student31@example.com"},"role":["Learner"]}, {"status":"Active","member":{"userId":"39","sourcedId":"","name":"Student 32","givenName":"Student","familyName":"32","email":"student32@example.com"},"role":["Learner"]}, {"status":"Active","member":{"userId":"40","sourcedId":"","name":"Student 33","givenName":"Student","familyName":"33","email":"student33@example.com"},"role":["Learner"]}, {"status":"Active","member":{"userId":"41","sourcedId":"","name":"Student 34","givenName":"Student","familyName":"34","email":"student34@example.com"},"role":["Learner"]}, {"status":"Active","member":{"userId":"42","sourcedId":"","name":"Student 35","givenName":"Student","familyName":"35","email":"student35@example.com"},"role":["Learner"]}, {"status":"Active","member":{"userId":"43","sourcedId":"","name":"Student 36","givenName":"Student","familyName":"36","email":"student36@example.com"},"role":["Learner"]}, {"status":"Active","member":{"userId":"44","sourcedId":"","name":"Student 37","givenName":"Student","familyName":"37","email":"student37@example.com"},"role":["Learner"]}, {"status":"Active","member":{"userId":"45","sourcedId":"","name":"Student 38","givenName":"Student","familyName":"38","email":"student38@example.com"},"role":["Learner"]}, {"status":"Active","member":{"userId":"46","sourcedId":"","name":"Student 39","givenName":"Student","familyName":"39","email":"student39@example.com"},"role":["Learner"]} ] } } }

      this was left untested in MDL-50658

      Either we need to re-test and close this issue as not a bug or continue work on it if needed

            lameze Simey Lameze
            marina Marina Glancy
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

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