MDL-34905 quiz: missing global $DB;
authorTim Hunt <T.J.Hunt@open.ac.uk>
Wed, 15 Aug 2012 09:25:25 +0000 (10:25 +0100)
committerTim Hunt <T.J.Hunt@open.ac.uk>
Wed, 15 Aug 2012 09:32:56 +0000 (10:32 +0100)
This code normally only runs when JS is disabled, which is why this was
not noticed before.

mod/quiz/attemptlib.php

index a4e70fa..7018487 100644 (file)
@@ -1335,6 +1335,8 @@ class quiz_attempt {
      * flagged state was changed in the request.
      */
     public function save_question_flags() {
+        global $DB;
+
         $transaction = $DB->start_delegated_transaction();
         $this->quba->update_question_flags();
         question_engine::save_questions_usage_by_activity($this->quba);