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
|
* @return array of strings
|
||||||
*/
|
*/
|
||||||
function question_list_instances($questionid) {
|
function question_list_instances($questionid) {
|
||||||
|
global $CFG;
|
||||||
$instances = array();
|
$instances = array();
|
||||||
$modules = get_records('modules');
|
$modules = get_records('modules');
|
||||||
foreach ($modules as $module) {
|
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';
|
$fn = $module->name.'_question_list_instances';
|
||||||
if (function_exists($fn)) {
|
if (function_exists($fn)) {
|
||||||
$instances = $instances + $fn($questionid);
|
$instances = $instances + $fn($questionid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return $instances;
|
return $instances;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns list of 'allowed' grades for grade selection
|
* Returns list of 'allowed' grades for grade selection
|
||||||
* formatted suitably for dropdown box function
|
* formatted suitably for dropdown box function
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue