]> git.mjollnir.org Git - moodle.git/commitdiff
Update old quiz logs
authormoodler <moodler>
Thu, 5 Feb 2004 05:00:52 +0000 (05:00 +0000)
committermoodler <moodler>
Thu, 5 Feb 2004 05:00:52 +0000 (05:00 +0000)
mod/quiz/db/mysql.php
mod/quiz/db/postgres7.php
mod/quiz/version.php

index 4a09717559441d613292677bcb33dcf9877ecdc6..e8cf3540f92c2dd01a3df386b91a4b6a59d6bdf8 100644 (file)
@@ -181,6 +181,17 @@ function quiz_upgrade($oldversion) {
         }
     }
 
+    if ($oldversion < 2004020500) {
+        if ($quizzes = get_records("quiz")) {
+            foreach ($quizzes as $quiz) {
+                if ($cm = get_coursemodule_from_instance("quiz", $quiz->id, $quiz->course)) {
+                    execute_sql("UPDATE {$CFG->prefix}log SET cmid = '$cm->id' 
+                                 WHERE module = 'quiz' AND url = 'view.php?id=$cm->id'");
+                }
+            }
+        }
+    }
+
     return true;
 }
 
index 6997247cd0857f588c8fc99e7fe6f27e46a5fdac..d80da9b9fd51120560955489221409e731205e21 100644 (file)
@@ -136,6 +136,17 @@ function quiz_upgrade($oldversion) {
         }
     }
 
+    if ($oldversion < 2004020500) {
+        if ($quizzes = get_records("quiz")) {
+            foreach ($quizzes as $quiz) {
+                if ($cm = get_coursemodule_from_instance("quiz", $quiz->id, $quiz->course)) {
+                    execute_sql("UPDATE {$CFG->prefix}log SET cmid = '$cm->id' 
+                                 WHERE module = 'quiz' AND url = 'view.php?id=$cm->id'");
+                }
+            }
+        }
+    }
+
     return true;
 }
 
index 3e69b99d2dca3aaece749e1f048261d5ddbad0af..81810f6cca6fc523843bafc542c134050291afb4 100644 (file)
@@ -5,8 +5,8 @@
 //  This fragment is called by moodle_needs_upgrading() and /admin/index.php
 ////////////////////////////////////////////////////////////////////////////////
 
-$module->version  = 2004013101;   // The (date) version of this module
-$module->requires = 2004013101;  // Requires this Moodle version
+$module->version  = 2004020500;   // The (date) version of this module
+$module->requires = 2004013101;   // Requires this Moodle version
 $module->cron     = 0;            // How often should cron check this module (seconds)?
 
 ?>