From 36e48cb82fea9fb96925a89eb311e01f3e507181 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Thu, 17 May 2012 10:58:29 +0100 Subject: [PATCH] MDL-33048 quiz / my moodle: fatal error due to missing include. --- mod/quiz/lib.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mod/quiz/lib.php b/mod/quiz/lib.php index f7fc003b1e7..9f0a4c19f24 100644 --- a/mod/quiz/lib.php +++ b/mod/quiz/lib.php @@ -483,7 +483,12 @@ function quiz_cron() { * array if there are none. */ function quiz_get_user_attempts($quizid, $userid, $status = 'finished', $includepreviews = false) { - global $DB; + global $DB, $CFG; + // TODO MDL-33071 it is very annoying to have to included all of locallib.php + // just to get the quiz_attempt::FINISHED constants, but I will try to sort + // that out properly for Moodle 2.4. For now, I will just do a quick fix for + // MDL-33048. + require_once($CFG->dirroot . '/mod/quiz/locallib.php'); $params = array(); switch ($status) {