Note: You are currently viewing documentation for Moodle 2.3. Up-to-date documentation for the latest stable version is available here: Enrol Sync: Course reinitialisation command file.

Enrol Sync: Course reinitialisation command file: Difference between revisions

From MoodleDocs
m (Text replacement - "class="nicetable"" to "class="wikitable"")
 
Line 16: Line 16:
the file MUST containt a first line giving column names in:
the file MUST containt a first line giving column names in:


{| class="nicetable"
{| class="wikitable"
|-
|-
! Column name  
! Column name  

Latest revision as of 15:20, 10 August 2021

Back to index

This file allows asking the "course reinitialisation tool" for massive reinitialisation of a set of courses, using several options per course. As expected in this special case, this tools WILL NOT BE PROCESSED BY CRON !

A report file is generated after execution of the test in the special sync file cabinet at the following location:

sync/reports

This file can be retrieved using the embedded file manager.

File format

The file format is a CSV file using either ';' or ',' separator. Note semicolon sep is preferred in case course names use comma as textual admitted char.

the file MUST containt a first line giving column names in:

Column name Value
shortname* Course shortname
events* yes/no
logs* yes/no
notes* yes/no
grades* items/grades/nothing
roles* list of 'guest admin student teacher editingteacher'
groups* members/groupes/nothing
modules* all/[+/-]module names list
forum_all 1/0
forum_subscriptions 1/0
chat 1/0
... 1/0
  • Mandatory columns

Developer notes: some provision is given by the Moodle framework for obtaining the specific reinitialisation options a module presents. Un fortunately, this provison is NOT extensible on contributed modules y the original reinitialisation function. Developpers can add a resetlib.php file in their module directory root, defining the '$modname'_reset_course_form_definition function to help handling such suboptions. this function should return an array of reinitialisation options variables. Developpers should also define the standard '$modname'_reset_course_form_default in modname/lib.php, to match these declarations.

File Sample

  shortname, roles, grades, groupes, events, logs, notes, modules
  short321, guest admin student teacher editingteacher, grades, members, no, yes, yes, all
  short322, student, items, groupes, yes, yes, yes, all
  short323, student teacher editingteacher, grades, members, yes, no, no, -forum -chat

The third data line says : all modules but forum and chat