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

(PARENT) Implement LMS foundation for sharing content to MoodleNet (share activities)

XMLWordPrintable

    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MOODLE_402_STABLE
    • MDL-75316-master-4
    • Hide

      Environment setup

      1. Set up and run the MoodleNet mock server (https://github.com/snake/moodlenet_mock) using 'moodlenet.test' as the domain.
      2. Log in as admin.
      3. Navigate to Admin > Security > HTTP security and clear the values for "cURL blocked hosts list " and "cURL allowed ports list" so they do not prevent us from reaching the MoodleNet mock server.

      Testing for MDL-75319

      Initial setup

      1. Log in as admin.
      2. Navigate to Admin > Server > OAuth 2 services.
      3. Click on the "MoodleNet' button.
      4. Change the URL to "https://moodlenet.test" (so that it points to the mock running locally).
      5. Click Save changes.
      6. Navigate to Admin > Server > OAuth 2 services.
      7. Click on the "Custom" button.
      8. Fill in the form with the below values:
        1. Name: Test service
        2. Client ID: secret
        3. Client secret: thisissecret
      9. Click Save changes.
      10. Disable all the services by clicking on the "eye" icon.

      Testing 1

      1. Navigate to "Site administration > Development > Experimental".
      2. Verify that you will see a setting called "Enable sharing to MoodleNet".
      3. Verify that the default value is unchecked.
      4. Navigate to "Site administration > General > MoodleNet.
      5. Verify that you will not see MoodleNet outbound settings.
      6. Verify that you will see MoodleNet inbound settings.

      Testing 2

      1. Navigate to "Site administration > Development > Experimental".
      2. Enable the "Enable sharing to MoodleNet" setting.
      3. Navigate to "Site administration > General > MoodleNet.
      4. Verify that you will see MoodleNet outbound settings.
      5. Click on that section.
      6. Verify that the "OAuth 2 service" value is "None".
      7. Verify that you will see "Select the OAuth 2 service that is configured to talk to the MoodleNet server. If the service doesn't exist yet, you will need to create it."
      8. Click on the "create" link.
      9. Verify that you will see the OAuth 2 services page.

      Testing 3

      1. Enable all the created services by clicking on the "eye" icon.
      2. Navigate to "Site administration > General > MoodleNet > MoodleNet outbound settings".
      3. Verify that you will see MoodleNet in the "OAuth 2 service" select box.
      4. Verify that you will not see Test service in the "OAuth 2 service" select box.

      Testing 4

      1. Navigate to Site admin > Users > Permissions > Capability overview.
      2. Search "moodlenet:shareactivity" and select the capability that appears.
      3. Under roles, select All and click "Get the overview".
      4. Verify under "Permissions in System", only Manager and Teacher are set to "Allow".

       

      Testing for MDL-75932

      Covered by unit tests.

      Testing for MDL-75933

      Covered by unit tests.

      Steps to run the PHPUnit:

      1. Set up and run the MoodleNet mock server (https://github.com/snake/moodlenet_mock) using 'moodlenet.test' as the domain
      2. Open config.php and add define('TEST_MOODLENET_MOCK_SERVER', 'https://moodlenet.test');
      3. Make sure all the tests in lib/tests/external/moodlenet_send_activity_test.php are passed.

       

      Testing for MDL-75785

      Behat test:

      1. Apply this commit: https://github.com/andrewnicols/moodle/commit/bf1d78348b714b8a6f65cff7af03e7e7ff56f8b6
      2. Re-init the Behat environment.
      3. Open config.php and add define('TEST_MOODLENET_MOCK_SERVER', 'https://moodlenet.test');
      4. Make sure all the tests in lib/tests/behat/moodlenet_outbound.feature are passed.

      Manual test:

      1. Navigate to Site Administration / Development / Experimental settings.
      2. Turn on (Checked) Enable sharing to MoodleNet (outbound).
      3. Save changes.
      4. Navigate to Site Administration / Server / OAuth 2 services.
      5. Click on the MoodleNet button.
      6. Change the Service base URL to: moodlenet.test
      7. Change the Name to: MoodleNet Local
      8. Save changes.
      9. Navigate to Site Administration / General / MoodleNet outbound settings.
      10. Select MoodleNet Local in the OAuth 2 service dropdown.
      11. Create a new Course.
      12. Create a new Assignment activity inside the created Course. Set the description to "Hello world".
      13. Login as a non-editing teacher/student role.
      14. Navigate to the Assignment activity.
      15. Verify that you will not see the Share to MoodleNet menu in the More menu.
      16. Login as editing teacher/manager role.
      17. Navigate to the Assignment activity.
      18. Click on the More menu.
      19. Verify that you will see Share to MoodleNet.
      20. Click on that menu option.
      21. Verify that you will see the activity name and activity type.
      22. Verify that you will see You are sharing this to MoodleNet as a resource.
      23. Verify that you will see: Sharing to: MoodleNet Local.
      24. Click on the Share button.
      25. Verify that a new popup will be open and ask you to authorize with MoodleNet mock server.
      26. Click Allow button.
      27. Verify that the popup will be closed and the dialogue will show that the system is packaging the activity.
      28. Verify that you will see a successful dialogue say that:  Saved to MoodleNet drafts 
      29. Verify that you will see Almost done! Visit your draft in MoodleNet to finish sharing your content.
      30. Close the modal.
      31. Navigate to Admin > Server > OAuth 2 services.
      32. Click on the "MoodleNet' button.
      33. Change the URL to "https://mn3.prototype.moodle.net" (so that it points to the MoodleNet prototype site).
      34. Change the name to "Prototype MoodleNet"
      35. Click Save changes.
      36. Navigate to Site Administration / General / MoodleNet outbound settings.
      37. Verify that you now see a "Prototype MoodleNet" option in the OAuth 2 service dropdown, in addition to MoodleNet Local and None.
      38. Change the OAuth 2 service to "Prototype MoodleNet"  and save the changes.
      39. Navigate to the the assignment activity you previously created.
      40. Click on the More menu and select Share to MoodleNet.
      41. Verify that you will see the activity name and activity type.
      42. Verify that you will see You are sharing this to MoodleNet as a resource.
      43. Verify that you will see: Sharing to: Prototype MoodleNet.
      44. Click on the Share button.
      45. Verify that a new popup will be open and ask you to authorize with the MoodleNet site.
      46. Click the cancel button.
      47. Verify that the popup closes, but that the share to MoodleNet modal is still open on the initial screen in the Moodle LMS.
      48. Click on the Share button again.
      49. Verify that the authorization popup appears again.
      50. This time, click Authorize.
      51. Verify that the popup is closed and the dialogue in the modal within Moodle LMS shows that the system is packaging the activity.
      52. Verify that you will see a successful dialogue say that:  Saved to MoodleNet drafts.
      53. Click the "Go to MoodleNet drafts" button at the bottom right of the modal.
      54. Verify that a new tab opens, which loads the MoodleNet prototype site.
      55. Verify that there is a heading which matches the name of the assignment.
      56. Verify that you seen an attachment with name ending in assign_backup.mbz.
      57. Verify that at the bottom of the information, you see "Hello world" (the activity's description).
      Show
      Environment setup Set up and run the MoodleNet mock server ( https://github.com/snake/moodlenet_mock ) using 'moodlenet.test' as the domain. Log in as admin. Navigate to Admin > Security > HTTP security and clear the values for "cURL blocked hosts list " and "cURL allowed ports list" so they do not prevent us from reaching the MoodleNet mock server. Testing for MDL-75319 Initial setup Log in as admin. Navigate to Admin > Server > OAuth 2 services. Click on the "MoodleNet' button. Change the URL to "https://moodlenet.test" (so that it points to the mock running locally). Click Save changes. Navigate to Admin > Server > OAuth 2 services. Click on the "Custom" button. Fill in the form with the below values: Name: Test service Client ID: secret Client secret: thisissecret Click Save changes. Disable all the services by clicking on the "eye" icon. Testing 1 Navigate to "Site administration > Development > Experimental". Verify that you will see a setting called "Enable sharing to MoodleNet". Verify that the default value is unchecked . Navigate to "Site administration > General > MoodleNet. Verify that you will not see MoodleNet outbound settings. Verify that you will see MoodleNet inbound settings. Testing 2 Navigate to "Site administration > Development > Experimental". Enable the "Enable sharing to MoodleNet" setting. Navigate to "Site administration > General > MoodleNet. Verify that you will see MoodleNet outbound settings. Click on that section. Verify that the "OAuth 2 service" value is "None". Verify that you will see "Select the OAuth 2 service that is configured to talk to the MoodleNet server. If the service doesn't exist yet, you will need to create it." Click on the "create" link. Verify that you will see the OAuth 2 services page. Testing 3 Enable all the created services by clicking on the "eye" icon. Navigate to "Site administration > General > MoodleNet > MoodleNet outbound settings". Verify that you will see MoodleNet in the "OAuth 2 service" select box. Verify that you will not see Test service in the "OAuth 2 service" select box. Testing 4 Navigate to Site admin > Users > Permissions > Capability overview. Search " moodlenet:shareactivity " and select the capability that appears. Under roles, select All and click "Get the overview". Verify under "Permissions in System", only Manager and Teacher are set to "Allow".   Testing for MDL-75932 Covered by unit tests. Testing for MDL-75933 Covered by unit tests. Steps to run the PHPUnit: Set up and run the MoodleNet mock server ( https://github.com/snake/moodlenet_mock ) using 'moodlenet.test' as the domain Open config.php and add define('TEST_MOODLENET_MOCK_SERVER', ' https://moodlenet.test'); Make sure all the tests in lib/tests/external/moodlenet_send_activity_test.php are passed.   Testing for MDL-75785 Behat test: Apply this commit: https://github.com/andrewnicols/moodle/commit/bf1d78348b714b8a6f65cff7af03e7e7ff56f8b6 Re-init the Behat environment. Open config.php and add define('TEST_MOODLENET_MOCK_SERVER', ' https://moodlenet.test'); Make sure all the tests in lib/tests/behat/moodlenet_outbound.feature are passed. Manual test: Navigate to Site Administration / Development / Experimental settings. Turn on (Checked) Enable sharing to MoodleNet (outbound). Save changes. Navigate to Site Administration / Server / OAuth 2 services. Click on the MoodleNet button. Change the Service base URL to: moodlenet.test Change the Name to: MoodleNet Local Save changes. Navigate to Site Administration / General / MoodleNet outbound settings. Select MoodleNet Local in the OAuth 2 service dropdown. Create a new Course. Create a new Assignment activity inside the created Course. Set the description to "Hello world". Login as a non-editing teacher/student role. Navigate to the Assignment activity. Verify that you will not see the Share to MoodleNet menu in the More menu. Login as editing teacher/manager role. Navigate to the Assignment activity. Click on the More menu. Verify that you will see Share to MoodleNet. Click on that menu option. Verify that you will see the activity name and activity type. Verify that you will see You are sharing this to MoodleNet as a resource. Verify that you will see: Sharing to: MoodleNet Local. Click on the Share button. Verify that a new popup will be open and ask you to authorize with MoodleNet mock server. Click Allow button. Verify that the popup will be closed and the dialogue will show that the system is packaging the activity. Verify that you will see a successful dialogue say that:  Saved to MoodleNet drafts  Verify that you will see Almost done! Visit your draft in MoodleNet to finish sharing your content. Close the modal. Navigate to Admin > Server > OAuth 2 services. Click on the "MoodleNet' button. Change the URL to "https://mn3.prototype.moodle.net" (so that it points to the MoodleNet prototype site). Change the name to "Prototype MoodleNet" Click Save changes. Navigate to Site Administration / General / MoodleNet outbound settings. Verify that you now see a "Prototype MoodleNet" option in the OAuth 2 service dropdown, in addition to MoodleNet Local and None. Change the OAuth 2 service to "Prototype MoodleNet"  and save the changes. Navigate to the the assignment activity you previously created. Click on the More menu and select Share to MoodleNet. Verify that you will see the activity name and activity type. Verify that you will see You are sharing this to MoodleNet as a resource. Verify that you will see: Sharing to: Prototype MoodleNet. Click on the Share button. Verify that a new popup will be open and ask you to authorize with the MoodleNet site. Click the cancel button. Verify that the popup closes, but that the share to MoodleNet modal is still open on the initial screen in the Moodle LMS. Click on the Share button again. Verify that the authorization popup appears again. This time, click Authorize. Verify that the popup is closed and the dialogue in the modal within Moodle LMS shows that the system is packaging the activity. Verify that you will see a successful dialogue say that:  Saved to MoodleNet drafts. Click the "Go to MoodleNet drafts" button at the bottom right of the modal. Verify that a new tab opens, which loads the MoodleNet prototype site. Verify that there is a heading which matches the name of the assignment. Verify that you seen an attachment with name ending in assign_backup.mbz. Verify that at the bottom of the information, you see "Hello world" (the activity's description).
    • 6
    • Team Hedgehog 4.1 sprint 0.4, Team Hedgehog 2023 Sprint 1.3, Team Hedgehog 2023 Sprint 1.4

      This issue is to collect the core features required to share activities to MoodleNet as a backup file, so they can be integrated together. This is the minimum functionality required for the feature to be functional.

      The key issues collected under this issue for integration are as follows (full requirements and user stories outlined in each of the respective issues):

      1. MDL-75319 - Create necessary site admin settings and capability to control the feature being available, and which MoodleNet instance content  can be shared to.
      2. MDL-75932 - Create core MoodleNet component and APIs to facilitate sharing resources to MoodleNet.
      3. MDL-75933 - Create web service(s) which perform necessary checks (eg capability) and utilise the API from #2.
      4. MDL-75785 - Implement the Share to MoodleNet modal and activity menu item (create necessary UI to use the feature).

        1. MDL-75319 - Testing 1.3.png
          MDL-75319 - Testing 1.3.png
          1.06 MB
        2. MDL-75319 - Testing 1.6-1.7.png
          MDL-75319 - Testing 1.6-1.7.png
          991 kB
        3. MDL-75319 - Testing 2.4.png
          MDL-75319 - Testing 2.4.png
          976 kB
        4. MDL-75319 - Testing 2.6-2.7.png
          MDL-75319 - Testing 2.6-2.7.png
          1.03 MB
        5. MDL-75319 - Testing 3.3-3.4.png
          MDL-75319 - Testing 3.3-3.4.png
          210 kB
        6. MDL-75319 - Testing 4.4.png
          MDL-75319 - Testing 4.4.png
          121 kB
        7. MDL-75785 - Behat 4.png
          MDL-75785 - Behat 4.png
          491 kB
        8. MDL-75785 - Manual 15.png
          MDL-75785 - Manual 15.png
          906 kB
        9. MDL-75785 - Manual 19.png
          MDL-75785 - Manual 19.png
          947 kB
        10. MDL-75785 - Manual 21-23.png
          MDL-75785 - Manual 21-23.png
          874 kB
        11. MDL-75785 - Manual 25.png
          MDL-75785 - Manual 25.png
          407 kB
        12. MDL-75785 - Manual 27-29.png
          MDL-75785 - Manual 27-29.png
          883 kB
        13. MDL-75785 - Manual 37.png
          MDL-75785 - Manual 37.png
          201 kB
        14. MDL-75785 - Manual 41-43.png
          MDL-75785 - Manual 41-43.png
          875 kB
        15. MDL-75785 - Manual 45.png
          MDL-75785 - Manual 45.png
          433 kB
        16. MDL-75785 - Manual 47.png
          MDL-75785 - Manual 47.png
          876 kB
        17. MDL-75785 - Manual 51-52.png
          MDL-75785 - Manual 51-52.png
          884 kB
        18. MDL-75785 - Manual 54-57.png
          MDL-75785 - Manual 54-57.png
          861 kB
        19. MDL-75933 - PHPUnit 3.png
          MDL-75933 - PHPUnit 3.png
          374 kB
        20. moodleneterror.png
          moodleneterror.png
          99 kB
        21. wellknown.png
          wellknown.png
          78 kB

            michaelh Michael Hawkins
            michaelh Michael Hawkins
            Huong Nguyen Huong Nguyen
            Jake Dallimore Jake Dallimore
            Andrew Lyons Andrew Lyons
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 4 days Original Estimate - 4 days
                4d
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 week, 3 days, 6 hours, 49 minutes
                1w 3d 6h 49m

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