Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-14804 - question_list_instances is broken - It does not include t…

…he each modules lib file before doing function_exists($module->name.'_question_list_instances').
  • Loading branch information...
commit 60ec12e055c9fd5a5a15525c1030a05c5b40413e 1 parent be074bc
tjhunt authored
Showing with 9 additions and 5 deletions.
  1. +9 −5 lib/questionlib.php
View
14 lib/questionlib.php
@@ -174,19 +174,23 @@ class cmoptions {
* @return array of strings
*/
function question_list_instances($questionid) {
+ global $CFG;
$instances = array();
$modules = get_records('modules');
foreach ($modules as $module) {
- $fn = $module->name.'_question_list_instances';
- if (function_exists($fn)) {
- $instances = $instances + $fn($questionid);
+ $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
* @return object ->gradeoptionsfull full array ->gradeoptions +ve only
Please sign in to comment.
Something went wrong with that request. Please try again.