Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

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

(no description)

File Size: 153 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.

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)
return: string Course state in JSON

Class: must  - X-Ref

execute_returns()   X-Ref
Webservice returns.

return: external_value