Issue Details (XML | Word | Printable)

Key: MDL-10614
Type: Bug Bug
Status: Open Open
Priority: Critical Critical
Assignee: Martin Dougiamas
Reporter: Wen Hao Chuang
Votes: 2
Watchers: 4
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Long page loading time when instructor uses Import function and have large number of courses on server

Created: 26/Jul/07 08:18 AM   Updated: 30/Sep/09 12:30 AM
Return to search
Component/s: Course
Affects Version/s: 1.8, 1.8.1, 1.8.2
Fix Version/s: None

File Attachments: 1. Text File courseimport.patch (5 kB)
2. Text File importpatch.txt (5 kB)

Issue Links:
Relates
 

Participants: Ann Adamcik, Jordan Markus, Martin Dougiamas and Wen Hao Chuang
Security Level: None
Affected Branches: MOODLE_18_STABLE


 Description  « Hide
When you have large number of courses on your server, an instructor login and clicks on Administration block > Import, it would take a LONG time for the Import page to load. A lot of times it will eventually time out.

We found a fix already and hope this could be checked into core. Comment out line 35 - 40 in /course/import/activities/mod.php

// if (empty($creator)) {
// $cat_courses = get_courses($course->category);
// } else {
// $cat_courses = array();
// }

No need to show other courses in category since instructors should not be able to import any courses that are not their own and admin can search for other courses. Hope this helps. :)


 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Wen Hao Chuang added a comment - 26/Jul/07 08:20 AM
oops, typo, I mean long loading time. By the way, when you load the server with 40000+ courses, it won't even finish loading the import page sometimes.

Ann Adamcik added a comment - 25/Sep/07 06:36 AM
This is a big issue for us, with ~8000 courses. We've had to increase the php max_execution_time, as the import page takes around 30 seconds to load for an instructor, 60 seconds for a site-level course creator, and 150 seconds for a site admin.

There are a couple of related problems with importing:

1) When logged in as a site admin, the 'courses I've taught' dropdown contains ALL courses on the system - it should only show those that the user has actually taught, if any.
2) When logged in as a course creator (with the role assigned for a particular category, not site-wide), neither the category dropdown, nor the search box appears - so a category-level course creator can create a new course in the category, but cannot import anything.


Ann Adamcik added a comment - 26/Sep/07 01:25 AM
I've rewritten course/import/activities/mod.php so that the import page behaves as follows:
  • For all users, the 'Courses I have taught' displays correctly - e.g. admins and course creators don't get a list of all courses here, only those they have actually taught.
  • The 'Courses in the same category' dropdown, and the search box, will now display for users with course create capability in the system or course category context.
  • If there are more than 100 courses in the same category, the course category dropdown will not be displayed.

Will someone please review the patch, and check it in if it looks reasonable?


Wen Hao Chuang added a comment - 26/Sep/07 01:44 AM
Martin could we maybe have someone to QA test Ann's patch and see if this could get into CORE? thanks!

Ann Adamcik added a comment - 16/Nov/07 01:39 AM
I found a couple of minor issues with the previous patch. Here's a corrected one.

Jordan Markus added a comment - 30/Sep/09 12:30 AM
I do agree with the Assignee. Try importing a class list at a time, then go on with your grading. Hope this helps