From: moodler Date: Thu, 5 Feb 2004 05:00:52 +0000 (+0000) Subject: Update old quiz logs X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=af7d68413f2fc98cabffef2676362f62cd1758ee;p=moodle.git Update old quiz logs --- diff --git a/mod/quiz/db/mysql.php b/mod/quiz/db/mysql.php index 4a09717559..e8cf3540f9 100644 --- a/mod/quiz/db/mysql.php +++ b/mod/quiz/db/mysql.php @@ -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; } diff --git a/mod/quiz/db/postgres7.php b/mod/quiz/db/postgres7.php index 6997247cd0..d80da9b9fd 100644 --- a/mod/quiz/db/postgres7.php +++ b/mod/quiz/db/postgres7.php @@ -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; } diff --git a/mod/quiz/version.php b/mod/quiz/version.php index 3e69b99d2d..81810f6cca 100644 --- a/mod/quiz/version.php +++ b/mod/quiz/version.php @@ -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)? ?>