Importing quizzes is slow

Importing quizzes is slow

by Visvanath Ratnaweera -
Number of replies: 11
Picture of Particularly helpful Moodlers Picture of Translators
Hi

A team of teachers share complete quizzes by maintaining the "original" quiz in one course (where all have the Teacher role) and importing them to their personal courses. They have a case where such an import takes 25 minutes!

Here are the details:
- The quiz has 50 questions, all Multiple-choice. All text heavy, with some containing images in the questions, some in the answers. Sizes around 50 to 400 kB. No audio, no video.

- The server is a dedicated Intel Xeon 2.4 GHz, quad core, 16 GB RAM, 4 TB SATA with (software) RAID 1.

- Moodle release 3.5 on LAMP (Debian 9, Apache, MariaDB), PHP 7.0, Opcache enabled 256 MB (only half being used)

- Performs beautifully in day-to-day operations which includes heave use of quiz, synchronously in classes of 15 to 25 students, sometimes three classes in parallel. No complaints about performance.

My initial guess is that the either the import procedure is very heavy on database - something similar to https://tracker.moodle.org/browse/MDL-29439 (which is very old and possibly not related). But sporadically there were enquiries like "Slow backup and restore of small quizes where there's a lot of question in course" https://moodle.org/mod/forum/discuss.php?d=379783.

Before starting on the general performance of the server or throwing more resources, I want to check with the quiz specialists whether this is to be expected.
Average of ratings: -
In reply to Visvanath Ratnaweera

Re: Importing quizzes is slow

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Quiz backup and restore times are normally contingent on the size of your question bank. For example, if you have a large system level quiz bank, this is very hard on backup and restore of quizzes as it includes the entire system level bank. Likewise, if there are a lot of quizzes in that particular course with a large number of questions in a course level question bank, it too will slow down the backup and restore process.
Average of ratings: Useful (2)
In reply to Emma Richardson

Re: Importing quizzes is slow

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Yes, I continue to notice this too, even with my "small" Moodle. I do have a lot of questions in my Question Bank.

This seems to be an ongoing issue. Maybe there is a Tracker item for it. If I simply want to "duplicate" a quiz (that might have 15 questions in it) it takes a very long time. I have found it faster to re-create the entire quiz from scratch. This is not that bothersome to me, since I can usually re-create a quiz in less than five minutes. Sure, it would be nice if the "duplicate" feature would take only 30 seconds.

I have understood this problem for a while.  But instructors who are new to Moodle would probably complain about how long it takes to duplicate a quiz.
Average of ratings: Useful (1)
In reply to Rick Jerz

Re: Importing quizzes is slow

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Emma, hi Rick

Thanks for reporting your observations! So this is the normal behaviour of Moodle. Importing and duplicating of complete quizzes are slow. The teachers who are experiencing this issue use MC tests heavily. Apart from the common quiz "originals" mentioned earlier, they have created many question categories under their dept. course category, totaling more then 1,500 questions.

Now on how to go ahead?
a) Does this process have potential for optimization? In that case we should find the tracker issues, if there are any, or add a tracker issue.

b) Could significant improvement achieved by system optimization, like DB optimizations, caches, etc?

c) Can we suggest alternative work-flow for them?

I am not expecting answers to all of them here, just thinking aloud.
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: Importing quizzes is slow

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
There have been multiple tracker items but it is a huge problem (as in it would take a lot of work to resolve). I used to have a great system level quiz bank for teachers to share and I ended up moving everything down to the individual course level. I now have question duplication but the backup and restore process works.
Average of ratings: Useful (2)
In reply to Emma Richardson

Re: Importing quizzes is slow

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Do you know if the Moodle User Association every addressed this issue? Might it be a good project to tackle?

We might be into a situation where we have this great Moodle question bank feature, but it creates problems when trying to duplicate a quiz because the quiz data tables have to deal with all the dependencies, etc. This could be why some other LMSs don't have a problem because questions are kept to a course and not shared. Perhaps an entirely different data configuration scheme. (Just thinking out loud. 🤔
Average of ratings: Useful (1)
In reply to Rick Jerz

Re: Importing quizzes is slow

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Emma, could you post here the tracker items you mentioned?

Hi Rick, I am not active on Moodle User Association? Are you?

To both, I fully agree, the question sharing facility over many levels is a great feature in Moodle. I can very well understand that it is very complicated. (Ever wondered why others don't have it?) I will keep it going in this site, even at the cost of adding more resources.
In reply to Visvanath Ratnaweera

Re: Importing quizzes is slow

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
This is the primary one - https://tracker.moodle.org/browse/MDL-41924 - Rick, you should put together a project proposal...
In reply to Emma Richardson

Re: Importing quizzes is slow

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Yes, I know, Emma. 😀 😀 😀.

Finding time is my current problem, but I will add this to my list.  Somehow, I think Tim (and others) know this, but making it a formal MUA project could help it along.

Visvanath, yes, I am a MUA member, but "active???".  I have not ever submitted a proposal, but I watch MUA discussions, participate, and I always try to vote.
In reply to Rick Jerz

Re: Importing quizzes is slow

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Vote? Ha, ha. I am not in to politics. If you feel like it and have time, you are welcome to make a proposal. Otherwise, don't worry.

I am trying to understand the fundamentals, to see what I can do on my own to help this particular Moodle installation.
In reply to Visvanath Ratnaweera

Re: Importing quizzes is slow

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

We have our fill of politics in the U.S.

Moodle has a very democratic system, so voting is a good thing, not a wasted thing like on other LMSs (C).

A good proposal takes some time to develop.

Average of ratings: Useful (3)