From e0349fd2d48209bd5c2ecfc0ef3b94bdcef931e0 Mon Sep 17 00:00:00 2001 From: ubuntu Date: Wed, 25 Dec 2013 13:19:20 +0200 Subject: [PATCH] CONTRIB-4724: New function module_scale_used_anywhere() should be implemented --- lib.php | 19 +++++++++++++++++++ version.php | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/lib.php b/lib.php index e1cb929..3d0a1fd 100755 --- a/lib.php +++ b/lib.php @@ -1268,3 +1268,22 @@ function game_get_completion_state($course, $cm, $userid, $type) { return $grade && $grade->score > 0; } +/** + * Checks if scale is being used by any instance of Game + * + * This is used to find out if scale used anywhere + * + * @global object + * @param int $scaleid + * @return boolean True if the scale is used by any Game + */ +function game_scale_used_anywhere($scaleid) { + global $DB; + + if ($scaleid and $DB->record_exists('game', array('grade'=>-$scaleid))) { + return true; + } else { + return false; + } +} + diff --git a/version.php b/version.php index 85cfd15..683e9ea 100755 --- a/version.php +++ b/version.php @@ -11,7 +11,7 @@ defined('MOODLE_INTERNAL') || die(); $module->component = 'mod_game'; // Full name of the plugin (used for diagnostics) -$module->version = 2013122503; // The current module version (Date: YYYYMMDDXX) +$module->version = 2013122504; // The current module version (Date: YYYYMMDDXX) $module->requires = 2010112400; // Requires Moodle 2.0 $module->cron = 0; // Period for cron to check this module (secs) -$module->release = '3.12.25.3'; +$module->release = '3.12.25.4';