tool:sync:files:enrols

Tool Sync: Enrolment update file format

File format

Field Value Default
cmd 'add', 'del', 'shift', 'disable', or 'enable' Tool setting
rolename(*) role short name -
enrol String manual
cid(*) id or short name, or the course ID number depending on the tool setting
uid(*) username, id, email, or idnumber depending on the tool setting
starttime unix timestamp -
endtime unix timestamp -
gcmd 'gadd', 'gaddcreate', 'greplace', 'greplacecreate' or 'gdel' -
g1 to g9 String -

(*) Mandatory fields

Fields

cmd

The command to run. If this column is absent, then the default value stored in the tool applies. If no default value is configured, then the value 'add' is used by default. The command can take the values:

  • add: Adds a role
  • del (delete): Removes an enrolment and the role
  • shift: Switches the user to the mentioned role by removing all their previous assignments
  • disable: Disables an enrolment (without changing its settings)
  • enable: Enables an existing enrolment

rolename

The short name of the role concerned (e.g. student, editingteacher, etc.)

enrol

The enrolment method concerned. If this column is absent from the file, then the file operations will ONLY concern role assignments, without questioning enrolment records. If it is present, but the cell value is empty, then the enrolment method considered by default is the manual method (manual).

cid

The course identifier. The source of the identifier depends on what was configured in the tool setting.

uid

The user identifier. The source of the identifier depends on what was configured in the tool setting.

starttime / endtime

The enrolment start and end times, expressed as a unix timestamp. These times are ONLY taken into account if the 'enrol' column exists.

gcmd

Secondary command related to groups. Defines the actions to run on the course groups when processing the line. This processing can be:

  • gadd: Adds the user to the group(s). If a group does not exist, does nothing for that group.
  • gaddcreate: Same, but creates the group(s) if they do not exist.
  • greplace: Moves the user into the group(s) by removing all previous assignments. Ignores non-existing groups.
  • greplacecreate: Same, but creates the non-existing groups.
  • gdel: Removes the user from the group(s).

g1 to g9

Each line of the command file can process an operation on a set of 1 to 9 groups. The CSV file must therefore include as many group columns as the command acting on the largest number (for example, if a line must modify 5 groups, then the file will have 5 group columns). Unused group cells must remain empty.

Minimal file

The minimal file has 3 columns: rolename, uid, cid. Its effect will be to add a role to existing enrolments (or other roles) for the users named in the courses named.

File example

tool/sync/files/enrols.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki