===== MoodleScript: ADD COURSE ===== ===== MoodleScript Script Engine ===== === Effect === Creates an empty course, taking the global course creation settings into account. === Syntax === ADD COURSE AS TO HAVING idnumber: visible: 0|1 === Examples === ADD COURSE Macroeconomics Level 2 AS MACECO2 TO idnumber:DIVERS HAVING idnumber: C_0345 === Specific attributes === * **coursefullname**: The full name of the course. Stops at the keyword AS. * **coursecategoryidentifier**: a unique course category identifier. 'current' can be used here. * **shortname**: a short name for the course. Must be unique. * **idnumber**: an external identifier for the course. === Default values === * **visible** : 1 === Impact on the execution stack context === The current course identifier is set to the id of the created course. The current course category identifier is set to the category where the created course is placed. [[:local:moodlescript:languagespecification|Back to the language index]] - [[:local:moodlescript|Back to the component index]]