In Moodle 1.6 and earlier (and possibly some later versions, I haven't checked) you could edit /moodle/course/edit.html to change the lines:
if(!sset($form->enrollable)) {
$form->enrollable = 1;
}
to:
if(!sset($form->enrollable)) {
$form->enrollable = 0;
}
and that would at least cause new courses to default to not enrollable. It didn't prevent restored courses from returning to enrollable, you'd still need to change that by hand when restoring a course.
In Moodle 1.9 You need to edit moodle/course/edit_form.php
find the line:
$mform->setDefault('enrollable', 1);
And change it to:
$mform->setDefault('enrollable', 0);
I did a quick test,(you may want to spend some time youself testing before relying on this) and this does appear to also cause courses that were backed up to restore with the default to not enrollable, so it may address your need entirely.
I tested out Mike's fix and couldn't get it to work. Here is how I was using it:
I made the change Mike suggested and then used a different enrollment plugin (LMB) to enroll everyone. Sadly you can still enroll yourself into any of the classes I created using LMB.
I was thinking that I might (gasp) alter the MySQL schema for Moodle. I took a look at the database table and noticed that:
+-------------------+-----------------------+------+-----+----------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------------+-----------------------+------+-----+----------+----------------+
enrollable | tinyint(1) unsigned | NO | | 1 | |
So the default for new courses is enrollable = 1. I was going to change that to 0. Now before I go crazy with that, I was wondering if anyone had any warnings or oh no moments when doing this to Moodle. When I update Moodle is this going to cause problems or will this be overwritten. Are there any other ideas about this?
In the mean time I'll be testing this on my test Moodle. Because that's why we have test Moodles.
As far as I know, this won't be overwritten on upgrades. And it shouldn't cause problems either. But be warned that some of the plugins ignore the default value, as they set it explicitly (and thus override it).
Saludos. Iñaki.
http://rosalynmetz.com/ideas/2008/12/23/making-moodle-courses-not-enrollable/
Just a word of caution, if you don't know what you're doing you could end up ruining your database, always test it first.
Works like a charm, thanks!
Regards,
-n
Basically we want to be able to completely disable that functionality. I haven't had time yet, but Im thinking about making a perm that signifies if a person can enrol or not using the 'Internal Enrollment' plugin. For now we have the default role set to guest, so it's easier to weed out the people who do it.
Method suggested by Michael Does not work in Moodle 1.9... Any idea ?