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

Implement web services for sharing content to MoodleNet

XMLWordPrintable

    • 10
    • Team Hedgehog Sprint 2.1, Team Hedgehog Sprint 2.2, Team Hedgehog 2023 Sprint 1.3

      One or more new web services are required which utilise the APIs created in MDL-75932, to facilitate sharing to MoodleNet. For the scope of this issue, it will likely only require a single web service.

      Requirements

      1. Parameters: cmid of the activity to be shared.
      2. Returns: MoodleNet draft resource URL.
      3. As this functionality lives in core, any web services will be located in lib/classes/external.
      4. Although in this phase of the project only a single MoodleNet instance will be available (so the teacher will not be able to change it in the UI), we should still require passing in the relevant MoodleNet site. This will future proof for later phases when multiple MoodleNet sites may be enabled for sharing.
      5. We could potentially also pass in a parameter for share format, which in the current scope would always be an activity backup (in future there would be options for raw file or URL).
      6. All operations must perform appropriate validation and capability checks (eg the capability created in MDL-75319) to ensure they are allowed to perform the relevant action. For example:
        1. The user performing the action is allowed to share to MoodleNet.
        2. The user is allowed to share the content they are trying to share.
        3. The MoodleNet site specified is one which the admin has enabled for sharing to (in this phase, it will have to match the one option that has been configured).
      7. Unit testing as appropriate.

      User stories

      Although this issue does not provide any functionality directly to teachers, it makes the relevant API available to the frontend which will help satisfy the following user stories:

      1. As a teacher, I can synchronously share a single activity/resource to MoodleNet as a Moodle backup file, so it is available for others to import into their Moodle courses.
      2. As a teacher, I will be provided with a link to my draft resource on MoodleNet, so I can complete any additional metadata requirements and publish my resource.
      3. As a teacher, I will be notified if an attempt to share to MoodleNet fails, so I can take appropriate action.
      4. As a site admin, I can enable or disable teachers' access to share to the MoodleNet site I have configured, so I have control over whether the content is published outside of my LMS.

      Out of scope

      1. Only the final success/fail status of the share/upload needs to be covered by the web service. Additional status updates (eg packaging) will be implemented separately on MDL-77298.
      2. This web service only needs to handle sharing a single activity. In future, when course sharing is implemented,  this will be covered by a separate web service. That means we should not need to factor course sharing into the design of this web service (except perhaps keeping it in mind we will want to name things in such a way that can be reused  consistently with course, eg something like  moodlenet_share_activity / moodlenet_share_single, so later we can be consistent with something like moodlenet_share_course).

            huongn@moodle.com Huong Nguyen
            michaelh Michael Hawkins
            Michael Hawkins Michael Hawkins
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 days, 10 minutes
                3d 10m

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