Monday, April 07, 2025

timeouts when duplicating a quiz on Moodle

One of our Moodle site maintainers complained that when he was duplicating a quiz, it was taking a long time and then giving a pop-up message saying "undefined". Conversation below:

Can you please check if there are any background jobs running?

Yes, Moodle runs lots of background jobs all the time. You can check these by going to 
https://ourdomain.org/admin/tasklogs.php

Right now, the server loads are very low, but I did get a db server load high alert (85%, as against a healthy load of up to 80%) at 10:15 am yesterday.

 Additionally, if many of your users are logged in, that can also slow down your response times. One possible mitigation in such cases would be for you to lock out other users by going to Maintenance Mode
https://ourdomain.org/admin/settings.php?section=maintenancemode
choose "Enable" and save - this will prevent other users from using the server - do your maintenance tasks, then go to the same page, and "Disable" - after which other users can continue to work.

when trying to create a quiz (just a duplicate of an existing one)

And as I have mentioned earlier, running large db queries will slow down the server and or make it time out. If that happens, please break down the action you wish to take into smaller chunks. "Just making a duplicate of a quiz" can be very db intensive if the quiz has a lot of content, multimedia content, a lot of users, a lot of responses, multimedia responses, and so on.

Attempted to create a blank quiz and it fails like below. This does not have any questions. So seriously something is wrong with the backend.

(removed a screenshot, which showed "Recalculating grades...")

Doing a search,

https://www.bing.com/search?pglt=641&q=creating+a+quiz+recalculating+grades+timeout+mod+questionnaire+moodle

Found

https://moodle.org/mod/forum/discuss.php?d=401173

https://tracker.moodle.org/browse/MDL-49324

So, this is possibly a bug. But I cannot fix Moodle bugs for you.

Not sure how I can help you with this. I can turn off cloudflare caching so that you will get a bit longer before timeout. (Found that this is already done.)

 Then you can try putting the site in maintenance mode and then try creating the quiz. But if that also fails, I have no further ideas.

Managed to create the sections for this module. Hopefully things get faster to load for users tomorrow.

No comments:

Post a Comment