mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-14804 - question_list_instances is broken - It does not include the each modules lib file before doing function_exists($module->name.'_question_list_instances').
This commit is contained in:
parent
45efd8efad
commit
698945eb18
1 changed files with 8 additions and 4 deletions
|
@ -248,18 +248,22 @@ class cmoptions {
|
|||
* @return array of strings
|
||||
*/
|
||||
function question_list_instances($questionid) {
|
||||
global $CFG;
|
||||
$instances = array();
|
||||
$modules = get_records('modules');
|
||||
foreach ($modules as $module) {
|
||||
$fullmod = $CFG->dirroot . '/mod/' . $module->name;
|
||||
if (file_exists($fullmod . '/lib.php')) {
|
||||
include_once($fullmod . '/lib.php');
|
||||
$fn = $module->name.'_question_list_instances';
|
||||
if (function_exists($fn)) {
|
||||
$instances = $instances + $fn($questionid);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $instances;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns list of 'allowed' grades for grade selection
|
||||
* formatted suitably for dropdown box function
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue