Multiple Moodles

Multiple Moodles

by Stephen Wilkinson -
Number of replies: 4

I work in a college with several faculties each with around 1000 students. At the moment I'm in the process of setting up a Moodle for the education faculty. However, other faculties are already interested...

I don't really want to add all students from all faculties to the current installation - after all students and teachers from one faculty do not need to be able to see courses in another. And keeping track of 4000 students in one Moodle might cause issues.

So I'm thinking of designing a pretty front end and then installing multiple Moodles - one for each faculty. However, this does fill up the web server.

Is it possible to have multiple Moodles - each with its own database and user files, but sharing the PHP modules etc. ?

Has anyone else used Moodle in this type of context?

Average of ratings: -
In reply to Stephen Wilkinson

Re: Multiple Moodles

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
There are various options, however the easiest is to keep each installation seperate. I do it by having my server's root point to /usr/local/moodle and then I install each moodle instance under this path (for example /usr/local/moodle/education, /usr/local/moodle/arts etc). Similarly I set up parallel moodledata locations (ie /usr/local/moodledata/education, /usr/local/moodledata/arts). Each instance has its own database.

You say this fills up the server, but each 'moodle' install is only 30-odd megabytes, how small is your disk??
In reply to Stephen Wilkinson

Re: Multiple Moodles

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I would try one Moodle first ... it will greatly simplify your maintenence and allow you to cope with the odd crossover student.  4000 students is really not that many.
In reply to Stephen Wilkinson

Re: Multiple Moodles

by Robert Lefebvre -
But if you really want to do what you say, I think you could make multiple versions of config.php, one for each faculty. So there would be a biology_config.php, math_config.php, etc.
Then in index php where it has "require_once("config.php");" place conditional statements to select the proper config. As in
If($faculty='math')
(
require_once("math_config.php");"
}
elseif($faculty='biology')
(
require_once("biology_config.php");"
}
etc. where the value of $faculty is sent with the link.


This would work, wouldn't it Martin? And it offers the advantage that to start a new faculty it only requires the creation of a new config and new database(and the slight addition again to the code in index.php)


In reply to Robert Lefebvre

Re: Multiple Moodles

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I can't see a way to "send the value of $faculty" with each link, exactly, and you wouldn't put the switch statements in index.php (because then you need to do it in all the hundreds of scripts), but I can see two other ways.

If your front page (non-Moodle) set a cookie containing the faculty before sending you to the Moodle front page, then your main config.php could be modified to check for this cookie, and then branch to set different values for each case. So you would only need to modify config.php.

Another way would be to set up four virtual Apache servers pointing to the same directory, and have the script check the current domain name being used, and use that as the basis to set up your different configs in config.php.