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

Allow links to be imported by tool_moodlenet (all versions)

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Prerequisites:

      1. Create a course, enrol a teacher and make sure there are at least 2 sections.
      2. The test client is installed at site root (https://github.com/moodle/moodle/compare/master...snake:moodlenet_test_client)
      3. Set the 'DEFAULTSITE', 'DEFAULTCOURSE' and 'DEFAULTSECTION' params in the test client script (at the top). DEFAULTCOURSE should be set to the id of the course you created. DEFAULTSECTION should be set to 1.

      Testing (no course and section)

      1. Make sure you're not logged in to Moodle
      2. Visit the test client (YORUSITE/testclient.php)
      3. Find the Cat example with no course and section provided and select 'Link' from the select menu
      4. Now click the 'Send to Moodle' button
      5. Confirm you're asked to log in to Moodle
      6. Log in to Moodle as a teacher in a course
      7. Confirm you are presented with a confirmation
      8. Click confirm
      9. Confirm you are presented with a course selection view
      10. Select a course
      11. Confirm you are presented with a format select view with options to add as a link
      12. Select the URL option and proceed
      13. Confirm the following:
        • You're redirected to course home
        • A URL resource has been created in section 0
        • The name of the URL matches the name on the test client
      14. Click the URL
      15. Confirm the description matches the summary on the test client

      Testing (with course and section)

      1. Make sure you're not logged in to Moodle
      2. Visit the test client (YORUSITE/testclient.php)
      3. Find the Cat example including course and section and click the 'Link' option from the select menu
      4. Now click the 'Send to Moodle' button
      5. Confirm you're asked to log in to Moodle
      6. Log in to Moodle as a teacher in a course
      7. Confirm you are presented with a confirmation
      8. Click confirm
      9. Confirm you are presented with a format select view with options to add as a link
      10. Select the URL option and proceed
      11. Confirm the following:
        • You're redirected to course home
        • A URL resource has been created in section 1
        • The name of the URL matches the name on the test client
      12. Click the URL
      13. Confirm the description matches the summary on the test client

      Regression test (file import testing)

      1. Make sure you're not logged in to Moodle
      2. Visit the test client (YORUSITE/testclient.php)
      3. Find the Cat example with no course and section provided and select 'File' from the select menu
      4. Now click the 'Send to Moodle' button
      5. Confirm you're asked to log in to Moodle
      6. Log in to Moodle as a teacher in a course
      7. Confirm you are presented with a confirmation
      8. Click confirm
      9. Confirm you are presented with a format select view with options to add as a file
      10. Select the resource option and proceed
      11. Confirm the following:
        • You're redirected to course home
        • A file resource has been created in section 0
        • The name of the resource matches the name on the test client
      12. Click the resource
      13. Confirm the description matches the summary on the test client

      Regression test (embedded media test case)

      1. Make sure you're not logged in to Moodle
      2. Visit the test client (YORUSITE/testclient.php)
      3. Find the Cat example with no course and section provided and select 'File' from the select menu
      4. Now click the 'Send to Moodle' button
      5. Confirm you're asked to log in to Moodle
      6. Log in to Moodle as a teacher in a course
      7. Confirm you are presented with a confirmation
      8. Click confirm
      9. Confirm you are presented with a format select view with options to add as a file
      10. Select the embed media option and proceed
      11. Confirm the following:
        • You're redirected to course home
        • A label resource has been created in section 0
      12. Click the resource
      13. Confirm the description is just an image and there is no text present.
      Show
      Prerequisites: Create a course, enrol a teacher and make sure there are at least 2 sections. The test client is installed at site root ( https://github.com/moodle/moodle/compare/master...snake:moodlenet_test_client ) Set the 'DEFAULTSITE', 'DEFAULTCOURSE' and 'DEFAULTSECTION' params in the test client script (at the top). DEFAULTCOURSE should be set to the id of the course you created. DEFAULTSECTION should be set to 1. Testing (no course and section) Make sure you're not logged in to Moodle Visit the test client (YORUSITE/testclient.php) Find the Cat example with no course and section provided and select 'Link' from the select menu Now click the 'Send to Moodle' button Confirm you're asked to log in to Moodle Log in to Moodle as a teacher in a course Confirm you are presented with a confirmation Click confirm Confirm you are presented with a course selection view Select a course Confirm you are presented with a format select view with options to add as a link Select the URL option and proceed Confirm the following: You're redirected to course home A URL resource has been created in section 0 The name of the URL matches the name on the test client Click the URL Confirm the description matches the summary on the test client Testing (with course and section) Make sure you're not logged in to Moodle Visit the test client (YORUSITE/testclient.php) Find the Cat example including course and section and click the 'Link' option from the select menu Now click the 'Send to Moodle' button Confirm you're asked to log in to Moodle Log in to Moodle as a teacher in a course Confirm you are presented with a confirmation Click confirm Confirm you are presented with a format select view with options to add as a link Select the URL option and proceed Confirm the following: You're redirected to course home A URL resource has been created in section 1 The name of the URL matches the name on the test client Click the URL Confirm the description matches the summary on the test client Regression test (file import testing) Make sure you're not logged in to Moodle Visit the test client (YORUSITE/testclient.php) Find the Cat example with no course and section provided and select 'File' from the select menu Now click the 'Send to Moodle' button Confirm you're asked to log in to Moodle Log in to Moodle as a teacher in a course Confirm you are presented with a confirmation Click confirm Confirm you are presented with a format select view with options to add as a file Select the resource option and proceed Confirm the following: You're redirected to course home A file resource has been created in section 0 The name of the resource matches the name on the test client Click the resource Confirm the description matches the summary on the test client Regression test (embedded media test case) Make sure you're not logged in to Moodle Visit the test client (YORUSITE/testclient.php) Find the Cat example with no course and section provided and select 'File' from the select menu Now click the 'Send to Moodle' button Confirm you're asked to log in to Moodle Log in to Moodle as a teacher in a course Confirm you are presented with a confirmation Click confirm Confirm you are presented with a format select view with options to add as a file Select the embed media option and proceed Confirm the following: You're redirected to course home A label resource has been created in section 0 Click the resource Confirm the description is just an image and there is no text present.
    • Affected Branches:
      MOODLE_39_STABLE
    • Pull from Repository:
    • Pull 3.8 Branch:
    • Pull Master Branch:
      MDL-68698-master
    • Story Points:
      5
    • Sprint:
      Moodlenet massive mop-up 2

      Description

      We currently have a workflow for file import only. We want to support links too.

      As a teacher
      I want to be able to send links I've shared on MoodleNet to Moodle and have them be imported into an activity instance
      So that I don't need to manually create resources in Moodle using the URL

      Acceptance criteria:
      1. [MoodleNet side]: A teacher is able to use the 'send to Moodle' button in MoodleNet to initiate an import for a link.
      2. Once initiated, the workflow should present the same steps as the file import process (confirm, course select, format select)
      3. Relevant strings should be updated to reflect the name of the item being imported during the various stages
      4. The teacher is able to select from a range of supported link handlers at the 'format select' stage.
      5. Once selected, the resource should be created and should have a 'name' and 'description' value matching those provided by MoodleNet.
      6. mod_url must always be available to handle link import in core, and other modules should also be able to register interest in handling links (core already supports this - we just want to confirm it works nicely)

      Spec:
      1. MoodleNet will provide a 'type' field in the POST data being sent to admin/tool/moodlenet/import.php, letting Moodle know whether a resource is to be treated as a file or as a link. Supported values are 'link' and 'file' right now only.
      2. MoodleNet will send JSON data in the 'resource_info' field in the aforementioned POST, containing 'name' and 'summary' fields, among others. These are to be used for the 'name' and 'description' values in Moodle. Sample below:

      {
        "collection": {
          "community": {
            "canonicalUrl": "https://team.moodle.net/pub/actors/K12_teachers",
            "icon": "https://team.moodle.net/uploads/01E2K4E9HWJK4ZQ5M8J2D6PA1H/school.jpg",
            "name": "K12 teachers",
            "preferredUsername": "K12_teachers@team.moodle.net",
            "summary": "Just a general space to hang out and chat if you're a schoolteacher!"
          },
          "canonicalUrl": "https://team.moodle.net/pub/actors/Teacher_humour",
          "icon": null,
          "name": "Teacher humour",
          "preferredUsername": "Teacher_humour@team.moodle.net",
          "summary": "Share memes and other funny things you come across! (keep it clean, people)"
        },
        "canonicalUrl": "https://team.moodle.net/pub/objects/e7a8770b-b6b2-40fb-a6ae-da9ed6a0203d",
        "icon": "https://s18670.pcdn.co/wp-content/uploads/laughing.jpg",
        "licence": "CC-BY-SA",
        "name": "30 Cheesy Teacher Jokes That Crack Us Up",
        "summary": "Need a good laugh? We've got you covered.",
        "url": "https://www.weareteachers.com/cheesy-teacher-jokes/"
      } 

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jaked Jake Dallimore
              Reporter:
              jaked Jake Dallimore
              Peer reviewer:
              Mathew May
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              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 - 4 days, 1 minute
                  4d 1m