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

Create admin tool to deal with MoodleNet communication (tool_moodlenet all versions)

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Deferred
    • Affects Version/s: 3.9
    • Fix Version/s: None
    • Component/s: Other
    • Testing Instructions:
      Hide

      This issue is part of a larger set of issues, so won't land by itself.

      If you wish to test the import flow (simulating the 'Send to Moodle' post)

      1. Checkout the test client branch (based on this branch):

        git pull https://github.com/snake/moodle.git moodlenet_test_client
        

        Note: You will need to edit the file 'testclient.php' and change any references to localhost/master to your own site.

      2. Hit YOURSITE/testclient.php from the browser
      3. You can now simulate a valid or invalid post from this page
      4. You can also disable MoodleNet from advanced features and check that the posts both result in an appropriate user error.
      Show
      This issue is part of a larger set of issues, so won't land by itself. If you wish to test the import flow (simulating the 'Send to Moodle' post) Checkout the test client branch (based on this branch): git pull https://github.com/snake/moodle.git moodlenet_test_client Note: You will need to edit the file 'testclient.php' and change any references to localhost/master to your own site. Hit YOURSITE/testclient.php from the browser You can now simulate a valid or invalid post from this page You can also disable MoodleNet from advanced features and check that the posts both result in an appropriate user error.
    • Affected Branches:
      MOODLE_39_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-67887-master
    • Story Points:
      5
    • Sprint:
      Activity Sprint 8

      Description

      This issue is a foundation for several others as it creates the admin tool plugin (tool_moodlenet) and the basic communication flow between MoodleNet and Moodle. More specifically, it provides the endpoint which MoodleNet can POST information about the file (as JSON) to.

      This issue will help us to complete the following user story (it won't fully complete it because it only deals with the endpoint, not the processing + decision code):

      User Story Approach
      As a teacher, after selecting a resource in MoodleNet,
      I am redirected to my Moodle site where I can decide what
      to do with the imported resource.
      MoodleNet will POST information about the resource, as JSON,
      to the Moodle endpoint. The endpoint will process the data and present the user with options for import.

      Acceptance criteria:

      • There is a new admin tool 'tool_moodlenet' created in core.
      • The plugin provides an endpoint for MoodleNet to POST to
      • MoodleNet should be able to POST to this endpoint (we need to simulate this in in testing in the first instance as it isn't built yet), regardless of whether a user is logged in or not and the POST data should be retained after login for use by the tool.
      • The referring MoodleNet page should be captured and present as a param in the wantsurl.

      We require a plugin (admin tool) to handle receiving requests to include MoodleNet content into a course.

      It has been suggested that the workflow could be similar to how plugins are installed from the plugin database (moodle.org).
      Plugin workflow - The button to install a plugin is a base64 encoded string which contains information (name, component, version) related to the plugin to make a request back to fetch it later. - End plugin workflow.

      • Checks need to be done as to whether accepting files from MoodleNet is allowed by the system.
      • The user needs to be logged in with an authenticated account.
      • After getting the file it then has to be decided what to do with it
        • Backup files to ultimately be restored.
        • Other file types to be handled with a call back to activity plugins.
        • An option to just put the file into the private files area of the user.
      User story Approach
      As a teacher (in Moodle), I am redirected to my Moodle site, and the MoodleNet resource is processed so I can use it in my Moodle site I am redirected to the 'import from MoodleNet' flow on my Moodle site. The details of the MoodleNet instance and details of the MoodleNet resource are included in the redirect
      I am prompted to login if not already authenticated into Moodle. The flow should continue after logging in.
      Moodle downloads the file to user's private files, analyses the file and the metadata provided by MoodleNet about the resource, and takes the following action based on the type: * Course/activity backup (MBZ): Moodle automatically commences the course/activity restore workflow *
        • I am prompted to select where I want to restore the course, or in which course and section I want to restore the activity.
      • Any other file or link:
        • Moodle determines what actions are most suitable based on the type of file, and the user can choose among a sub-set of:
          • File resource
          • Label resource
          • Keep in private files
          • Page resource
            ***Link resource
        • If adding as a resource, I'm prompted to select which course and section I want to import the file or link in (with the course and/or section the flow started in pre-selected, when applicable).
      • The file or link is added to the correct course and section, or file area (e.g. Private Files) as selected

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jaked Jake Dallimore
              Reporter:
              abgreeve Adrian Greeve
              Peer reviewer:
              Peter Dias
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              2 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 - 1 day, 1 minute
                  1d 1m