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

Provide site details when redirecting to moodlenet (tool_moodlenet 3.7 and 3.8

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 3.7.6, 3.8.3
    • Fix Version/s: None
    • Component/s: Other
    • Testing Instructions:
      Hide

      Goto tool_moodlenet/instance
      page (admin/tool/moodlenet/instance.php?course=courseid&section=sectionid)

      Confirm when you click the 'Browse official HQ Moodlenet' button it goes to

      https://team.moodle.net/endpoint?site={url_encode(webroot)}&path={urlencode(admin/tool/moodlenet/import.php?course=courseid&section=sectionid)}
      

      Show
      Goto tool_moodlenet/instance page (admin/tool/moodlenet/instance.php?course=courseid&section=sectionid) Confirm when you click the 'Browse official HQ Moodlenet' button it goes to https://team.moodle.net/endpoint?site={url_encode(webroot)}&path={urlencode(admin/tool/moodlenet/import.php?course=courseid&section=sectionid)}
    • Affected Branches:
      MOODLE_37_STABLE, MOODLE_38_STABLE
    • Pull from Repository:
    • Pull 3.8 Branch:
    • Story Points:
      1
    • Sprint:
      Moodlenet massive mop-up 2

      Description

      Please ensure when redirecting to moodlenet to provide details about our site and path.

      Taken from chat with Jake:

      OFFICIALSITECONFIGVALUE?site=URLENCODEDSITE&path=URLENCODEDPATH

      It's likely that both the mod_moodlenet plugin as well as the master implementation will have to be checked and updated.

      Jake:
      Here's the commit running on the prototype site for 3.8 right now (https://github.com/moodle/moodle/commit/ccd0304161a3d8e9520e6167b97074084e991c9f). We'll need to clean this up and add support for the case when a user enters their MoodleNet profile URL into the page (this commit only handles the "Browse official" button), but it gives you the idea.

      The main things we need:

      1. tool_moodlenet: Fix tool_moodlenet_add_resource_redirect_url() so that when it's returning the 'instance.php' url, it also includes course and section params so these can be used in creation of the 'path' param that we'll provide to MoodleNet. Given the path param creation needs to happen on the instance page, the instance page needs to know the course and section.
      2. tool_moodlenet: Make sure that when sending the user to MoodleNet, we send them to the following URL:

      MOODLENETSITE?site=URLENCODEDSITE&path=URLENCODEDPATH

      Where:
      MOODLENETSITE is the URL of the users MoodleNet site, including the path to the (as yet to be determined) endpoint. e.g. https://their.moodlenet.site
      URLENCODEDSITE is the Moodle site ($CFG->wwwroot), urlencoded. E.g. urlencode("https//example.moodle.site");
      URLENCODEDPATH is the path to the tool's import script, including any params such as course and section, also urlencoded. E.g. urlencode("/admin/tool/moodlenet/import.php?course=x&section=y");

      Note: I would not recommend exploiting the renderable+template context as a way to get data into the rendered like I've done here. This was just a quick patch to test end to end comms with the test client.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 10 minutes
                4h 10m