Note: You are currently viewing documentation for Moodle 2.4. Up-to-date documentation for the latest stable version of Moodle may be available here: Flat file.

Flat file: Difference between revisions

From MoodleDocs
No edit summary
(Edits and links)
Line 1: Line 1:
Location: ''Administration > Courses > [[Enrolment plugins|Enrolments]]''
Location: ''Administration > Courses > [[Enrolment plugins|Enrolments]]''


It allows to enrol (or unenrol) existing users to existing courses, choosing roles they will have in each course, based on informations in a file.
A flat file allows enrolment management (enrol or unenrol) of existing users in existing course. The file is read one time by Moodle then erased. The file is located in the moodle file structure as a text file and [[Cron]] provides the timing when it is read.


This method checks for an enrolment file at the specified location. You can put the file anywhere you want (as long as Moodle can find it), but if you don't specify a location, Moodle will look for the file at ''.../moodledata/1/enrolments.txt''. If you do specify a file path, it should be absolute (eg /var/moodledata/enrolments.txt) and can be read and modified by the webserver process.
==Options==
If Moodle finds a new file, it will process the data and delete the file afterwards. This process is run via the [[Cron]] job. You can choose to have a log file send to the administrator and to send a notification to teachers and students.
The site administrator should edit the settings for a flat file if it is enabled.  
[[Image:Enrolment Flat file options.png|thumb|center|Options for flat file enrolment]]  


The file should be structured with the action, role, student number (see student profile) and course ID number (see course settings).
The default name and location of the file is ''.../moodledata/1/enrolments.txt''.  If you do specify a file path, it should be absolute (eg /var/moodledata/enrolments.txt) and can be read and modified by the webserver process.


You'll get all details on how to format the flat file on the settings page (accessed via the edit flat file settings link in ''Administration > Courses > Enrolments''). You '''must''' read it !
You can choose to have a log file send to the administrator and to send a notification to teachers and students.
 
==Flat file structure==
The file should be structured with the action, role, user id, and course ID number.  Optionally a start time and end time can be added as additional fields.
 
The edit field link will give details on how to format the flat file on the Administration > Courses > Enrolments'')page.
 
[[Image:Enrolment Flat file data.png|thumb|center|Flat file instructions for fields and records]]
   
   
==See also==
==See also==
*[[Upload users]]
*[[Upload users]]
 
*[[Bulk user actions]] how to download site user information (including userIDs
Using Moodle forum discussions:
Using Moodle forum discussions:
*[http://moodle.org/mod/forum/discuss.php?d=13289 How does flat file work?]
*[http://moodle.org/mod/forum/discuss.php?d=13289 How does flat file work?]

Revision as of 17:28, 20 July 2008

Location: Administration > Courses > Enrolments

A flat file allows enrolment management (enrol or unenrol) of existing users in existing course. The file is read one time by Moodle then erased. The file is located in the moodle file structure as a text file and Cron provides the timing when it is read.

Options

The site administrator should edit the settings for a flat file if it is enabled.

Options for flat file enrolment

The default name and location of the file is .../moodledata/1/enrolments.txt. If you do specify a file path, it should be absolute (eg /var/moodledata/enrolments.txt) and can be read and modified by the webserver process.

You can choose to have a log file send to the administrator and to send a notification to teachers and students.

Flat file structure

The file should be structured with the action, role, user id, and course ID number. Optionally a start time and end time can be added as additional fields.

The edit field link will give details on how to format the flat file on the Administration > Courses > Enrolments)page.

Flat file instructions for fields and records

See also

Using Moodle forum discussions: