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

Create a method which returns a MoodleNet endpoint (tool_moodlenet all versions)

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 3.7.5, 3.8.2, 3.9
    • Fix Version/s: None
    • Component/s: Other
    • Story Points:
      3
    • Sprint:
      Activity Sprint 9

      Description

      Several issues need a method to generate a MoodleNet endpoint URL for a given profileurl and return path.

      The way this URL is created is as follows:

      1. Take the users MoodleNet profile URL which will be in the format "@name@their.moodlenet.site), grabbing the site portion only.
      2. Assume a fixed MoodleNet path of '/endpoint' for now (this is being worked on by the MoodleNet team)
      3. Append the endpoint to the site URL - e.g. their.moodle.site/endpoint
      4. Next, we need to pass 2 params to this endpoint - site and path - which represent the site and path we want MoodleNet to send users back to, once content is selected.
        • Site: this is the Moodle site URL, urlencoded. E.g. urlencode('my.moodle.site')
        • Path: this is the path to our MoodleNet plugin import endpoint, urlencoded, and can include params itself (this is important for getting back the course and section). E.g. urlencode('admin/tool/moodlenet/import.php?course=2&section=4')
      5. The endpoint should now look like:
        their.moodle.site/endpoint?site=ENCODEDSITE&path=ENCODEDPATHWITHPARAMS

      The acceptance criteria for this issue are as follows:

      1. Generated URL should match the above syntax.
      2. Unit tests to confirm the params and can be urldecoded and match the inputs.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              peterdias Peter Dias
              Reporter:
              jaked Jake Dallimore
              Peer reviewer:
              Mihail Geshoski Mihail Geshoski
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 5 hours, 16 minutes
                  5h 16m