Quiz edit page really slow when many question displayed in a category

Quiz edit page really slow when many question displayed in a category

by François Lizotte -
Number of replies: 3
Picture of Particularly helpful Moodlers

Under Moodle 3.0.7

While helping a teacher with drag and drop issues in her quiz edit page, I realized that the page took a vers long time to load (over a minute).

She was selecting questions form a category that has over 1000 questions. If we display all the questions in the category view (no pagination), it causes the questionbank.ajax.php to load all of the questions. Going back to 20 questions per page fixes it.

I know nothing about Ajax, but it seems strange to me that the way you display your questions in a course category has such an effect on the loading time.

I reproduced the problem on a smaller scale with 100 questions in a category. If all displayed, it takes over 2 seconds to load, while paginated (20 questions per page), the average loading time is around 450 ms.


François

Average of ratings: -
In reply to François Lizotte

Re: Quiz edit page really slow when many question displayed in a category

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I don't understand why it is so slow either. It should be linear in the number of questions.

In reply to Tim Hunt

Re: Quiz edit page really slow when many question displayed in a category

by François Lizotte -
Picture of Particularly helpful Moodlers

But why is there a difference in what is loaded on the quiz edit page if the question category is displayed on multiple pages or not? (Excuse my syntax)

In reply to François Lizotte

Re: Quiz edit page really slow when many question displayed in a category

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I must admit, I don't understand that. The contents of the question bank is loaded after the main page load, using an ajax call. It should not slow things down, and anyway it should not be that slow. Would need some serious debugging to understand it.