When you have about 30 question categories, the page that show it load to slow
Re: When you have about 30 question categories, the page that show it load to slow
Re: When you have about 30 question categories, the page that show it load to slow
Re: When you have about 30 question categories, the page that show it load to slow
Re: When you have about 30 question categories, the page that show it load to slow
Re: When you have about 30 question categories, the page that show it load to slow
Re: When you have about 30 question categories, the page that show it load to slow
However, is you only have 100 categories in total, it really should not be that show. 100 is a very small number in computer terms.
Oh, I see. the category_class.php file uses a different algorithm for building the category tree than the other pages.
in the initialize method in category_class.php, can you try replacing
$this->categories = $this->get_question_categories(null, "parent, sortorder, name ASC");
$this->categories = $this->arrange_categories($this->categories);
with
$this->categories = question_category_options($this->course->id);
Re: When you have about 30 question categories, the page that show it load to slow
Firstly, I tried to replace code as your suggestion but it's failed. That page can't load.
Secordly, you're right, we don't need paging the hierarchical in drop-down menu but I think we need to paging in the table below. As I understand, it only paging based on number of level1 categories right now. That's original source code is used to count all categories which have no parent.
foreach( $this->categories as $category ) {
if ($category->parent==0) {
++$count;
}
For example, we have 100 or 200 categories but only have 10 first level categories, so original approach still not do paging. It's difficult and slow for viewer when they try to view the table.
One more thing, when we try to drop one categories, its children moved to the same level as it automatically instead of deleteing cascade option.
Hope can get some suggestion from you in my case. Thank you very much.
Re: When you have about 30 question categories, the page that show it load to slow
If the quiz editing screen displays quickly enough, then we know that it is possible to get all the categories form the database and display them quickly enough. Therefore, the category editing page must be written in an inefficient way and can be optimised.
If the quiz editing page is also slow, we have a bigger problem.
Sorry the change I suggested last night did not work. It seemed right, but I just typed it into the forum post - I did not have time to try it myself.
Re: When you have about 30 question categories, the page that show it load to slow
Re: When you have about 30 question categories, the page that show it load to slow
Therefore, the table of categories should be just as fast or slow as the dropdowns on the other pages.
At the moment printing the table is much slower. That is a bug. I know how to fix it, I just need to find the time.
Re: When you have about 30 question categories, the page that show it load to slow
Re: When you have about 30 question categories, the page that show it load to slow
Can you try it and confirm that it works, and that it solves your performance problems. This is quite a big change, so if possible test it on a backup of your live site, not your production server.
I developed this against HEAD (1.9 dev), but it should work in 1.7+ too.
Re: When you have about 30 question categories, the page that show it load to slow
Re: When you have about 30 question categories, the page that show it load to slow
Reworking the code made me realise what made this page so slow. Next to each category, there is a dropdown you can use to change the parent of each category. Each of those dropdowns is different. It is working out the contents of each of those dropdowns that is taking the time.
The only solution I can think of is to get rid of those dropdowns, if we do, then the only way to change the parent of a category would be by clicking on the edit category icon. What do people think?
Re: When you have about 30 question categories, the page that show it load to slow
I will try this one but hope to hear any ideas.
Thank you very much.