There is core_courseformat_get_state web service that outputs the state of a course format. The web service will only work for formats that have a state with 3 specific top level elements:
- course
- section
- cm
It is possible that some course formats will want additional states, for example if they have areas that contain a sub-set of the sections in a course.
The overall aim would be that a course format doing this would then be able to easily manage that state and take advantage of the course editor functionality for it.
The current code hardcore the 3 top elements because it is implemented in the core_courseformat_get_state webservice and the core_courseformat\state_update class. It would be good if the get_state webservice used output to export the entire state, not only the root elements. For example, having a "core_crouseformat\output\local\state" to export the whole state will help.