From 28926a08e9782d51716e29672a773605dd10c0b5 Mon Sep 17 00:00:00 2001 From: defacer Date: Thu, 27 Jan 2005 03:10:57 +0000 Subject: [PATCH] Changing that despicable grade column from mdl_quiz_grades to a floating point data type, as it should be. --- mod/quiz/db/mysql.php | 5 +++++ mod/quiz/db/mysql.sql | 2 +- mod/quiz/db/postgres7.php | 4 ++++ mod/quiz/db/postgres7.sql | 2 +- mod/quiz/version.php | 2 +- 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/mod/quiz/db/mysql.php b/mod/quiz/db/mysql.php index c5eee5a24b..1fdcd40ed1 100644 --- a/mod/quiz/db/mysql.php +++ b/mod/quiz/db/mysql.php @@ -305,6 +305,11 @@ function quiz_upgrade($oldversion) { if ($oldversion < 2005010300) { table_column("quiz", "", "questionsperpage", "integer", "10", "", "0", "not null", "review"); } + + if ($oldversion < 2005012700) { + table_column('quiz_grades', 'grade', 'grade', 'real', 2, ''); + } + return true; } diff --git a/mod/quiz/db/mysql.sql b/mod/quiz/db/mysql.sql index 0f53ecdb75..eb05ad9618 100644 --- a/mod/quiz/db/mysql.sql +++ b/mod/quiz/db/mysql.sql @@ -165,7 +165,7 @@ CREATE TABLE `prefix_quiz_grades` ( `id` int(10) unsigned NOT NULL auto_increment, `quiz` int(10) unsigned NOT NULL default '0', `userid` int(10) unsigned NOT NULL default '0', - `grade` varchar(10) NOT NULL default '0.0', + `grade` real NOT NULL default '0', `timemodified` int(10) unsigned NOT NULL default '0', PRIMARY KEY (`id`), KEY `quiz` (`quiz`), diff --git a/mod/quiz/db/postgres7.php b/mod/quiz/db/postgres7.php index 2e9dcefa2c..ec51a44070 100644 --- a/mod/quiz/db/postgres7.php +++ b/mod/quiz/db/postgres7.php @@ -291,6 +291,10 @@ function quiz_upgrade($oldversion) { table_column("quiz", "", "questionsperpage", "integer", "10", "", "0", "not null", "review"); } + if ($oldversion < 2005012700) { + table_column('quiz_grades', 'grade', 'grade', 'real', 2, ''); + } + return true; } diff --git a/mod/quiz/db/postgres7.sql b/mod/quiz/db/postgres7.sql index 663496990e..a0723d053e 100644 --- a/mod/quiz/db/postgres7.sql +++ b/mod/quiz/db/postgres7.sql @@ -107,7 +107,7 @@ CREATE TABLE prefix_quiz_grades ( id SERIAL PRIMARY KEY, quiz integer NOT NULL default '0', userid integer NOT NULL default '0', - grade varchar(10) NOT NULL default '0.0', + grade real NOT NULL default '0', timemodified integer NOT NULL default '0' ); diff --git a/mod/quiz/version.php b/mod/quiz/version.php index 0dc77dec81..446a5db24a 100644 --- a/mod/quiz/version.php +++ b/mod/quiz/version.php @@ -5,7 +5,7 @@ // This fragment is called by moodle_needs_upgrading() and /admin/index.php //////////////////////////////////////////////////////////////////////////////// -$module->version = 2005010300; // The (date) version of this module +$module->version = 2005012700; // The (date) version of this module $module->requires = 2005010100; // Requires this Moodle version $module->cron = 0; // How often should cron check this module (seconds)? -- 2.39.5