{{ :blocks:logo-apl.png?nolink |}} ==== Tool sync: Course creation file format (2.x and 3.x) ==== ====Introduction==== * Each line of the file contains one record. * The data of each record are separated by a comma (or another separator character, so the tool configuration must be checked). * The first record contains the names of the fields that make up the records, and thus determines the structure of the rest of the file. ^ Field ^ Value ^ | category | Forward?Slash-Delimited Category "Path" String (new categories are created as necessary) OR Integer Database Category ID | | cost | String(10) | | format | String('social','topics','weeks', ...) | | **fullname* ** | String(254) | | groupmode | 0=NOGROUPS,1=SEPARATEGROUPS,2=VISIBLEGROUPS | | groupmodeforce | 0=FALSE,1=TRUE | | guest | 0=NO,1=YES | | self | 0=NO, 1=YES | | idnumber | String(100) | | lang | String(10) as lowercase 2 letters lang code | | maxbytes | Integer(Site Max) | | newsitems | Integer(10) | | **shortname* ** | String(15) | | showgrades | 0=FALSE,1=TRUE | | showreports | 0=FALSE,1=TRUE | | sortorder | Integer | | startdate | Timestamp | | summary | Text | | teacher1,2,...?_account | Search String that returns only one User Account (as used in Administration ยป Edit user accounts OR Integer Database User ID | | teacher1,2,...?_role | String(40) | | template |String| | theme |String(50) | | timecreated | String Date Literal | | timemodified | String Date Literal | | topic0 main heading?, topic1 ... topic52 topic/week headings? | Text | | visible | 0=FALSE,1=TRUE | | visibleold | 0=FALSE, 1=TRUE | | legacyfiles | 0=FALSE, 1=TRUE | ==== Mandatory fields ==== * Only the fields marked in bold are mandatory. * As course building can use several strategies (restore, default creation), the rules differ depending on the case. //In general:// * if you provide a ''template'' corresponding to a complete course archive, this archive contains all the values needed to build the course. The only field you will probably need to care about in addition is the ''category'' field, in order to place the generated course in a suitable location. * if you do not provide a ''template'', then some attributes will be useful to properly define the state of the course to create, otherwise the "default" values (''Site administration > courses >'') apply. ==== Course category ==== * The category can be given as a "path" separated by slashes ("/"). Missing categories from the root will be created as needed. * If the category is given as an integer, it is the category Id and this category MUST exist. * Commas separating the data must be encoded; the script will automatically interpret them as commas. * For boolean data, use 0 for false and 1 for true. ==== Using templates or backups to load content at creation ==== The course can be created from a template. This template designates either: * the short name or ''shortname'' of a course of the platform with a saved archive WITHOUT user DATA. * If the content of the template field cannot be matched to an existing course, then it can designate a physical access path to a compatible Moodle archive (.mbz) stored locally on the server. --------------- [[:Tool:Sync|Back to the component index]] - [[:start|Back to catalogue]]