Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

moodle16cleanup: mod/hotpot set the correct column datatype and default

value
  • Loading branch information...
commit 9a2eb087aa8f19169ab0b4f1bb9da437f7e614f2 1 parent 7a3a4cf
martinlanghoff authored
Showing with 46 additions and 2 deletions.
  1. +45 −1 mod/hotpot/db/postgres7.php
  2. +1 −1  mod/hotpot/version.php
46 mod/hotpot/db/postgres7.php
View
@@ -41,6 +41,50 @@ function hotpot_upgrade($oldversion) {
require_once $update_to_v2;
$ok = $ok && hotpot_update_to_v2_1_18();
}
- return $ok;
+
+
+ if ($oldversion < 2006050201) {
+
+ modify_database('', 'ALTER TABLE prefix_hotpot
+ ALTER COLUMN studentfeedbackurl SET DEFAULT \'\',
+ ALTER COLUMN studentfeedbackurl SET NOT NULL,
+ ALTER COLUMN clickreporting SET DEFAULT 0,
+ ALTER COLUMN studentfeedback SET DEFAULT 0');
+
+ modify_database('', 'ALTER TABLE prefix_hotpot_strings
+ ALTER COLUMN string SET DEFAULT \'\'');
+
+ modify_database('', 'ALTER TABLE prefix_hotpot_responses
+ ALTER COLUMN hints TYPE int2,
+ ALTER COLUMN hints SET DEFAULT 0,
+ ALTER COLUMN ignored SET DEFAULT \'\',
+ ALTER COLUMN ignored SET NOT NULL,
+ ALTER COLUMN score TYPE int2,
+ ALTER COLUMN score SET DEFAULT 0,
+ ALTER COLUMN correct SET DEFAULT \'\',
+ ALTER COLUMN correct SET NOT NULL,
+ ALTER COLUMN weighting TYPE int2,
+ ALTER COLUMN weighting SET DEFAULT 0,
+ ALTER COLUMN wrong SET DEFAULT \'\',
+ ALTER COLUMN wrong SET NOT NULL,
+ ALTER COLUMN checks TYPE int2,
+ ALTER COLUMN checks SET DEFAULT 0,
+ ALTER COLUMN clues TYPE int2,
+ ALTER COLUMN clues SET DEFAULT 0');
+
+ modify_database('', 'ALTER TABLE prefix_hotpot_questions
+ ALTER COLUMN "type" SET DEFAULT 0');
+
+ modify_database('', 'ALTER TABLE prefix_hotpot_attempts
+ ALTER COLUMN penalties TYPE smallint,
+ ALTER COLUMN penalties SET DEFAULT 0,
+ ALTER COLUMN score TYPE smallint,
+ ALTER COLUMN score SET DEFAULT 0,
+ ALTER COLUMN status SET DEFAULT 1');
+
+ }
+
+
+ return $ok;
}
?>
2  mod/hotpot/version.php
View
@@ -3,7 +3,7 @@
/// Code fragment to define the version of hotpot
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
/////////////////////////////////////////////////////////////////////////////////
-$module->version = 2006050200; // release date of this version (see note below)
+$module->version = 2006050201; // release date of this version (see note below)
$module->release = 'v2.1.19'; // human-friendly version name (used in mod/hotpot/lib.php)
$module->cron = 0; // period for cron to check this module (secs)
// interpretation of YYYYMMDDXY version numbers
Please sign in to comment.
Something went wrong with that request. Please try again.