Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 400 and 402] [Versions 400 and 403]

(no description)

File Size: 158 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes

update_course:: (2 methods):
  execute_parameters()
  execute()

must:: (1 method):
  execute_returns()


Class: update_course  - X-Ref

External secrvie to update the course from the course editor components.

execute_parameters()   X-Ref
Webservice parameters.

return: external_function_parameters

execute(string $action, int $courseid, array $ids = [],?int $targetsectionid = null, ?int $targetcmid = null)   X-Ref
This webservice will execute any action from the course editor. The default actions
are located in {@see \core_courseformat\stateactions} but the format plugin can extend that class
in format_XXX\course.

The specific action methods will register in a {@see \core_courseformat\stateupdates} all the affected
sections, cms and course attribute. This object (in JSON) will be sent back to the
frontend editor to refresh the updated state elements.

By default, {@see \core_courseformat\stateupdates} will register only create, delete and update events
on cms, sections and the general course data. However, if some plugin needs adhoc messages for
its own mutation module, extend this class in format_XXX\course.

return: string Course state in JSON
param: string $action the action name to execute
param: int $courseid the course id
param: int[] $ids the affected ids (section or cm depending on the action)
param: int|null $targetsectionid optional target section id (for move action)
param: int|null $targetcmid optional target cm id (for move action)

Class: must  - X-Ref

execute_returns()   X-Ref
Webservice returns.

return: external_value