How to replicate in moodle?

How to replicate in moodle?

Danishka Navin -
回帖数:10

Hi there,

We are planning to deploy hundreds of moodle child servers to be replicate from few parent servers for a moodle based online exam.

Idea is to deploy single moodle server to each exam center and around 20 clients connect to each exam center.

moodle servers in exam centers suppose to get the exam questions from a centralized server(s) and send the results from all exam center moodle servers to centralized server(s).

Can we do the replication using moodle itself or should we use database replication?

I highly appreciate if you can advice on this.


回复Danishka Navin

Re: How to replicate in moodle?

Visvanath Ratnaweera -
Particularly helpful Moodlers的头像 Translators的头像
Hi

The short answer is, No. Neither the Moodle has this capability built-in nor there exist any Open Source add-on to do this. You can find more discussions in this forum through the Advanced search https://moodle.org/mod/forum/search.php?id=5.

For a longer answer, one should distinguish between two approaches.
a) At Moodle site level
This is what you were thinking of. And you also guessed the problem. Once the databases grow independently, they can not be put together, there'll be so many collisions. Considering the scope of Moodle, with a dozen of entirely different built-in tools (called Activities) and hundreds of tables in the database, this is a complicated task. I remember in the old discussions, a Moodle Partner (who also fund the Moodle project) had shown interest. If you can raise funds, that would be neat, and a big enhancement.

Another idea. There is Moodle fork iomad (iomad.org) which has added multi-tenancy to Moodle. If you can convince iomad that a satelite Moodle is a tenent, it imight be able to reimport the satellite Moodles to seperate tenants.

b) Specific to an on-line exam (Quiz)
If you szenario is just a one time distributed exam, it must be easier to copy just the resource Quiz to satellite Moodles and then re-import them with the student submissions. You might want to ask in the Quiz forum https://moodle.org/mod/forum/view.php?id=737.

Whatever approach you take, the user registration will affect the solution.

There is good news on the satellite side though - read "Moodle for android offline users" https://moodle.org/mod/forum/discuss.php?d=373051.
回复Visvanath Ratnaweera

Re: How to replicate in moodle?

Danishka Navin -

@Visvanath,


I highly appreciated your prompt reply.


>b) Specific to an on-line exam (Quiz)


Yes, my use-case is exactly this. Running few days of (3-4 days) online exam using hundreds of moodle servers in around the country and each exam center has 20 clients connect to local moodle server.

Local moodle server suppose to get the quiz from centralized (main) moodle server and return all results back to it.

All tasks such as user registration, quiz upload and final results issue suppose to do in a centralized server.


回复Danishka Navin

Re-importing a one time on-line examination on distributes servers

Visvanath Ratnaweera -
Particularly helpful Moodlers的头像 Translators的头像
Hi Danishka

That is a much simpler szenario than the first one. I noticed that you have experience in Linux but new to Moodle. Suggest looking for a solution with stock Moodle.

Here are some ideas off the cuff. The folk in the Quiz forum can tell you more.

- Central server
Create the resources, basically a course and a quiz. Then register and enroll users

- Distribute
You can either duplicate the whole site through https://docs.moodle.org/en/Site_backup and https://docs.moodle.org/en/Site_restore or export the course with users https://docs.moodle.org/en/Course_backup and restore in the satellite servers https://docs.moodle.org/en/Course_restore.

Well, you have the problem of the bulk, 200 satellite servers. That is a different story. If the satellite server is a Raspberry Pi as in the MoodleBox, you can create one and then copy (dd) the SD cards! Also easy transportation, in the shirt pocket!!

- Re-import
This is the tricky part. I am not sure how course restore exactly behaves, if you are lucky, you can restore the quizzes from the satellite servers in to the single original quiz.

Failing that, there is always the low-tech solution: Export the quiz results from the satellites in a spread-sheet format and do the processing in your spread-sheet program.
眨眼

P.S.: You might want to request the moderator to move the discussion to the Quiz forum. Notice the new subject line.

回复Visvanath Ratnaweera

Re: Re-importing a one time on-line examination on distributes servers

Danishka Navin -



>Well, you have the problem of the bulk, 200 satellite servers. That is a different story. If the satellite server is a Raspberry Pi as in the MoodleBox, you can create one and then copy (dd) the SD cards! Also easy transportation, in the shirt pocket!!

We are planning to use existing server (currently not utilize) boxes in each lab. 


>Failing that, there is always the low-tech solution: Export the quiz results from the satellites in a spread-sheet format and do the processing in your spread-sheet program.

This can be an issue as someone else can alter results. It would be great if officials able to see the overall progress in a central server when the exams in progress.


Moreover information such as how many users connected at a given time and which are the satellite servers in use/active or not, provide clear idea on what's going on.


>P.S.: You might want to request the moderator to move the discussion to the Quiz forum. Notice the new subject line.

That would be great. I am not sure how to request that.

回复Danishka Navin

Re: Re-importing a one time on-line examination on distributed servers

Visvanath Ratnaweera -
Particularly helpful Moodlers的头像 Translators的头像
If you find a solution as I sketched in my previous post, you can keep the Moodle-related work pretty simple. Your obstacles are elsewhere: slow, unreliable or non-existent Internet connectivity at the sites, untrustworthy people, all these distributed over 1000(?) sites - for a serious exam! In short, your major problems are not Moodle-related.

Since I have an idea of the country you are talking about ;) I'll make an exception and offer you some ideas over PM.
回复Danishka Navin

Re: How to replicate in moodle?

Howard Miller -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像

I'm not at all clear what problem you are trying to fix here. Why all this complication?

回复Howard Miller

Re: How to replicate in moodle?

Danishka Navin -

@Howard,

There are several hundreds of exam centres around the country and having local moodle server makes students to continue even though internet connectivity issue between a exam centre and central moodle server.


During the exam, it required follow similar guidelines and procedures to make sure nothing went wrong and no exam cheating, etc.

I am trying to achieve following requirement.

01. Loading a quiz from one central server.

02. Distribute quiz to child servers in exam centres (lets say 1000 local moodle servers).

03. Run the local exams in 1000 exam centres (20 clients for each centre).

04. Get the results back to central servers asap.



回复Danishka Navin

Re: How to replicate in moodle?

Howard Miller -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像

I don't know where you are but I assume unreliable internet access is a real problem for you?

This comes up every so often. I believe the "one laptop per child" project did some work on this. They had satellite Moodle servers in schools. This was a long time ago and it all died away (unless anybody knows different). I haven't heard of any satisfactory solution to your needs.

回复Howard Miller

Re: How to replicate in moodle?

Danishka Navin -

>I don't know where you are but I assume unreliable internet access is a real problem for you?

Yes, there is a high chance that connectivity from a remote exam server to central server fail.


>This comes up every so often. I believe the "one laptop per child" project did some work on this. They had satellite Moodle servers in schools. This was a long time ago and it all died away (unless anybody knows different). I haven't heard of any satisfactory solution to your needs.


Thanks for your info. I can check with them as well.


回复Danishka Navin

Re: How to replicate in moodle?

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像

The overall approach seems quite a sensible solution to the problem you face. The question is how best to make the pieces work together.

As others have said, for distributing the quiz definitions, Moodle backup format is probably the right way to go. There is they just a question how much you need to automate this. However, Moodle backup is quite easy to script from PHP. (If I had to do this, I would make a local plugin. On the central server, it would provide some web services to tell the satellite servers which exams to download, and the ability to download Moodle backups of those exams. On the statellite servers, it would call the central web services, download the relevant backups, and restore them. (there would need to be some configuration pages to control this.)

For getting the results back, this would be a bit more work, but possible. I can think of two general approaches:

  • You could again use backup (this time with user data) to get the quiz attempts from the satellite. However, from Moodle's point of view the quiz on each satellite is a separate quiz, so if you restored them, the attempts would not be combined. You would have to write some custom restore code. Moodle backup and restore is very powerful, but this makes the code hard to understand.
  • Therefore, it might just be easier to write a custom export of the quiz attempt data in any format that it is easy for you to work with, and then a custom import that replays the attempts into a single quiz on the central server. To do this, you would need to understand http://docs.moodle.org/dev/Overview_of_the_Moodle_question_engine#Detailed_data_about_an_attempt and https://docs.moodle.org/dev/Using_the_question_engine_from_module.


As an aside, for setting up exams in Moodle, we fould that the Single activity course format was very helpful.