From a1e836ace4f99f26ba62c1892e690beb3ff79c7a Mon Sep 17 00:00:00 2001 From: gbateson Date: Mon, 16 Mar 2009 01:46:54 +0000 Subject: [PATCH] force Moodle gradebook grades to be recalculated when HotPot grade method is changed: http://moodle.org/mod/forum/discuss.php?d=117691 --- mod/hotpot/db/upgrade.php | 26 +++++++++++++------------- mod/hotpot/version.php | 4 ++-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/mod/hotpot/db/upgrade.php b/mod/hotpot/db/upgrade.php index a1c3f3315d9..7fd3a5d6d58 100644 --- a/mod/hotpot/db/upgrade.php +++ b/mod/hotpot/db/upgrade.php @@ -10,8 +10,20 @@ function xmldb_hotpot_upgrade($oldversion=0) { //===== 1.9.0 upgrade line ======// + if ($result && $oldversion < 2007101512) { + // save and disable setting to display debugging messages + $debug = $db->debug; + $db->debug = false; + + notify('Fixing hotpot grades, this may take a while if there are many hotpots...', 'notifysuccess'); + hotpot_fix_grades(); + + // restore $db->debug + $db->debug = $debug; + } + // update hotpot grades from sites earlier than Moodle 1.9, 27th March 2008 - if ($result && $oldversion < 2007101511) { + if ($result && $oldversion < 2007101513) { // ensure "hotpot_update_grades" function is available require_once $CFG->dirroot.'/mod/hotpot/lib.php'; @@ -27,18 +39,6 @@ function xmldb_hotpot_upgrade($oldversion=0) { $db->debug = $debug; } - if ($result && $oldversion < 2007101512) { - // save and disable setting to display debugging messages - $debug = $db->debug; - $db->debug = false; - - notify('Fixing hotpot grades, this may take a while if there are many hotpots...', 'notifysuccess'); - hotpot_fix_grades(); - - // restore $db->debug - $db->debug = $debug; - } - return $result; } diff --git a/mod/hotpot/version.php b/mod/hotpot/version.php index 90d5c788b69..fe71a7bf64f 100644 --- a/mod/hotpot/version.php +++ b/mod/hotpot/version.php @@ -3,8 +3,8 @@ /// Code fragment to define the version of hotpot /// This fragment is called by moodle_needs_upgrading() and /admin/index.php ///////////////////////////////////////////////////////////////////////////////// -$module->version = 2007101512; // release date of this version (see note below) -$module->release = 'v2.4.12'; // human-friendly version name (used in mod/hotpot/lib.php) +$module->version = 2007101513; // release date of this version (see note below) +$module->release = 'v2.4.13'; // human-friendly version name (used in mod/hotpot/lib.php) $module->requires = 2007101509; // Requires this Moodle version $module->cron = 0; // period for cron to check this module (secs) // interpretation of YYYYMMDDXY version numbers