-
Bug
-
Resolution: Fixed
-
Minor
-
5.0
-
MOODLE_500_STABLE
-
MOODLE_500_STABLE
-
MDL-84900_main -
-
-
Short description
Question bank selection in quiz not shown for power users.
Steps to reproduce
As a "power user" e.g. admin or some course manager that has access to a course area with a lot of courses:
- Go to a quiz or create a new quiz
- Go to questions and add a new question from the question bank
- In the dialogue menu of the quiz question bank click "switch bank"
Current output: the loading indicator is shown and then another dialogue window appears with the title "undefined".
Technical background
The problem is the consumption of memory in the filterlib.php
foreach ($cmcontextids as $contextid) {
|
// Copy course list. |
$FILTERLIB_PRIVATE->active[$contextid] = $courseactive; // Are there any changes to the active list? |
if (array_key_exists($contextid, $remainingactives)) { |
|
This snippet is in lib/filterlib.php line 681ff (in Moodle 4.6)
The out of memory occurs at the assignment in line 683.
In our system we usually have a memory limit set to 128MB. We have about 8000 question banks. In my test run as an admin this code snippet is executed about 500 times.
Increasing the memory to 1GB just extends the runtime and the snippet is executed about 2.5k still at the end there is an error (I didn't check if its the memory limit or max run time).
Suggestion
if there are too many question banks to be loaded, show the first 10 only with an option to search for a name of a bank, and load the filters for the displayed question banks only.
- has been marked as being related by
-
MDL-85069 Move questions not usable for power users having lots of question banks with lots of question categories
-
- Component lead review in progress
-