diff --git a/lib/questionlib.php b/lib/questionlib.php index e49a09ce5c1..00fd996e5ba 100644 --- a/lib/questionlib.php +++ b/lib/questionlib.php @@ -1853,12 +1853,19 @@ function question_pluginfile($course, $context, $component, $filearea, $args, $f include_once("$dir/lib.php"); $filefunction = $module . '_question_pluginfile'; - if (!function_exists($filefunction)) { - send_file_not_found(); + if (function_exists($filefunction)) { + $filefunction($course, $context, $component, $filearea, $qubaid, $slot, + $args, $forcedownload, $options); } - $filefunction($course, $context, $component, $filearea, $qubaid, $slot, - $args, $forcedownload, $options); + //okay, we're here so lets check for function without 'mod_'. + if(strpos($module, 'mod_') == 0) { + $filefunctionold = substr($module, 3) . '_question_pluginfile'; + if (function_exists($filefunctionold)) { + $filefunctionold($course, $context, $component, $filearea, $qubaid, $slot, + $args, $forcedownload, $options); + } + } send_file_not_found(); }