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

Create core_course_update_course webservice

    XMLWordPrintable

    Details

    • Sprint:
      Moppies Kanban, Moppies Kanban, Moppies Kanban

      Description

      Create an ajax webservice to be the course edition base for the new course editor in Moodle 4.0.

      This web service should be able to execute both core and format plugin edition functions and it will be invoked as a Ajax request by the new course UI components.

      The minimum arguments for this webservice are:

      • action (string): to identify which update must be performed. This string is used to identify the method to call internally.
      • courseid (int): the course where the action takes place.
      • ids (array) an array of section or cm ids (depending on the action)
      • (optional) targetsectionid(int): in case the action require a target section. For example "cm_moveto", "cm_copyto", "section_moveto" and "section_copyto" actions can require it.
      • (optional) targetcmid(int): in case the action requires a target course-module. For example "cm_moveto", "cm_copyto", "section_moveto" and "section_copyto" can require it.

      This webservice will delegate any action to core_course\stateactions class, or to format_xxx\course\stateactions if provided.

      There's a sample implementation of this plugin here: https://github.com/ferranrecio/moodle/blob/coursecreatetest02/course/classes/external/course_edit.php

      The return structure of any action will a be a "stateupdates" object. A stateupdates is a list of changes that must be executed at a frontend level in order to keep the UI updated. A sample code of the stateupdates class can be found here: https://github.com/ferranrecio/moodle/blob/coursecreatetest02/course/classes/stateupdates.php

      For now, phpunit test should fake a course format because no state actions will be provided yet.

       
      More information about this approach with the general architecture and how this external method will be used can be found in the section "External Interface Requirements" of the course creation document

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              tusefomal Ferran Recio
              Reporter:
              tusefomal Ferran Recio
              Peer reviewer:
              Ilya Tregubov Ilya Tregubov
              Integrator:
              Andrew Lyons Andrew Lyons
              Tester:
              CiBoT CiBoT
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/Dec/21

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 week, 2 days, 4 hours, 31 minutes
                  1w 2d 4h 31m