flat file unenroll

flat file unenroll

by Greg Rodenhiser -
Number of replies: 2
I am currently running Moodle 1.8.2 (on Linux). I am using the flat file enrollment plugin to create the roles for all our students/faculty. This has worked perfectly until I want to run some unenrolls. As we're now in our add/drop period I have a need to run removes for students in courses. According to the Flatfile enrollment plugin I use the following format:

To add a student:
add, student, ,

To remove a student:
del, student, ,

Well, the add works just fine (imported about 3000 students/faculty to their respective courses). Now I want to remove some students from their courses using the format above. I get the following error for each line in my feed.

:Unknown operation in field 1 - ignoring line

This enrollment feed contains all del entries. Again, my feed with all add lines works fine (and picks up courses that students have since added since the last time I ran the enrollment feed. I've tried using delete instead of del with no luck. Any ideas?????
Average of ratings: Useful (1)
In reply to Greg Rodenhiser

Re: flat file unenroll

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hummm, this is really strange. 'del' is the right keyword according to the code (I've had a look at it).

Just to see what's going on, you could edit .../enrol/flatfile/enrol.php and search for line 149 (in 1.8.2+) that reads:

$this->log .= "Unknown operation in field 1 - ignoring line\n";

and change it to:

$this->log .= "Unknown operation in field 1 -" . $fields[0] . "- ignoring line\n";

That will log what operation Moodle thinks you specified, instead of 'del' and allow us to track the error down.

Saludos. Iñaki.

Average of ratings: Useful (1)
In reply to Iñaki Arenaza

Re: flat file unenroll

by Greg Rodenhiser -
Grrrr... I found the problem. While I can have a space between fields in the add

add, student, ,

I can NOT have a space in the del feed

del,student,,

As soon I I removed the space after the commas it ran fine. Thanks for your response!!
Average of ratings: Useful (2)