Replace course content
course_content_setReplace a course's lessons by saving a complete new content version, which enrolled learners see immediately; settings such as price or visibility are changed with course_update instead. Earlier versions stay readable with course_content_get, so a bad write can be rolled back. This is not a patch: send the whole course every time, as blocks (EditorJS) or markdown (prose only), with H2 headers as section titles and H3 headers as unit titles. Keep each existing block's id from course_content_get: learners' answers, submissions and completion records are tied to block ids, so a block saved without its id (and every block written as markdown) no longer shows its learners' history. Get block shapes from block_type_list; its courseAssessments blocks (quiz, assignment, form, poll and similar) are valid ONLY in course content. Every call adds a version, even an identical one; returns the new version number and block count.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Course id (required). | |
| blocks | No | The complete lesson list as EditorJS blocks [{id?, type, data}], in order (must not be empty). Include each existing block's id to keep its learner records; blocks without one get a new id. Wins over markdown if both are sent. | |
| authorId | No | User recorded as this version's author; must belong to this site. Defaults to the site's first admin. | |
| markdown | No | The whole course as Markdown (headings, paragraphs, lists, checklists, quotes, tables, code), converted to blocks with new ids; it cannot express graded blocks. Use this OR blocks. |