Create multiple wikis in one go

Create multiple wikis in one go

by Iain Roberts -
Number of replies: 3
I would like to create a new wiki in each of several hundred courses. Apart from being attached to a different course, I would like each wiki to be identical - same name, same default first page, same description.

Creating hundreds of wikis manually would be pretty painful, so I'm looking for alternatives.

I thought manually editing the MySQL database might be the easiest way (generating some nice big SQL file which would create everything in one go) but it seems more complex that I'd hoped and could easily mess up the whole thing (in addition to tables mdl_wiki, mdl_wiki_entries, mdl_wiki pages and mdl_course_modules, there's a fairly obscure entry in the modinfo field in mdl_course and probably some others I haven't tracked down).

I've also had a look at hacking the php code to create the wikis, but tracing through the code is proving tough (it starts with course/modedit.php?add=wiki&... but my php isn't up to tracing it all through).

I'm using Moodle 1.9.2 with ewiki.

Any ideas?

Thanks,

Iain.

Average of ratings: -
In reply to Iain Roberts

Re: Create multiple wikis in one go

by Iain Roberts -
Having not had any replies on this one, and following a brief email conversation with Mike Churchward, one of the developers for the integration of ewiki and Moodle, I've concluded that this isn't easy to do and probably more involved and riskier than doing it the long, boring way.

There's certainly no supported way to do it. I assume that it would be possible to script it, but from looking at the code, I've just been unable to track down the functions that actually create a new wiki, at least in a way that would let me script it.
In reply to Iain Roberts

Re: Create multiple wikis in one go

by Marc Grober -
Actually, I think between using the directory feature I finally got figured out and the suggestion that pigui made I think you could be on to something.....

though I think that perhaps a php script that simply parsed the course IDs and created a wiki using the correct file from the correct site files directory if the course had yet to be accessed might be manageable.....
In reply to Iain Roberts

Re: Create multiple wikis in one go

by Jordi Piguillem -
Hi Ian.

I have an idea about how to solve your problem "easily".

Have you noticed that if you delete the default "News Forum" from a course another one is created?

You can hack you course formats (weeks, topics, etc ) to create a new wiki if it does not exists. You wouldn't have to deal with Moodle database and every wiki will be automatically created on user "demand" (teacher accessing to his course).

Hope it helps.

DFWikiLabs, Pigui.