Editing the way a csv is uploaded, auto populating fields.

Editing the way a csv is uploaded, auto populating fields.

by Christopher Lee -
Number of replies: 1
A PHP based question.
I have been altering the way the CSV upload works and I want to automatically populate a value for a CSV when it is uploaded. Say for instance, when a user is uploaded I want to add a group field, and set this value to 'Students', basically automatically adding them to a group for a course.
This is something I'm currently working on but I would appreciate any advice, help or direction to editing the way the CSV upload works, or if anyone has done anything similar in the past.
Average of ratings: -
In reply to Christopher Lee

Re: Editing the way a csv is uploaded, auto populating fields.

by Colin Fraser -

I do not understand what you mean by "I have been altering the way the CSV upload works..." Does this mean you are playing with the code and changing how the data is inserted into the database? Or you are creating fields for the data to be entered into the database via a flatfile? Either way a dangerous practice, no matter how well versed you may be in PHP. The other point here is why do you want to reinvent the wheel?  

If you haven't read the Moodle Docs on this try these bits first. That should tell you that what you say you want to do can be set as a default.