From 72036f9305517224f9bdc67771f2bfde93c143a2 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Mon, 14 Feb 2005 18:24:24 +0000 Subject: [PATCH] New quiz option addded: decimalpoints (used to decide the number of decimals showed in grades) --- mod/quiz/db/mysql.php | 4 ++++ mod/quiz/db/mysql.sql | 1 + mod/quiz/db/oci8po.sql | 1 + mod/quiz/db/postgres7.php | 4 ++++ mod/quiz/db/postgres7.sql | 1 + mod/quiz/version.php | 2 +- 6 files changed, 12 insertions(+), 1 deletion(-) diff --git a/mod/quiz/db/mysql.php b/mod/quiz/db/mysql.php index 1fdcd40ed1f..f7f90c237cb 100644 --- a/mod/quiz/db/mysql.php +++ b/mod/quiz/db/mysql.php @@ -310,6 +310,10 @@ function quiz_upgrade($oldversion) { table_column('quiz_grades', 'grade', 'grade', 'real', 2, ''); } + if ($oldversion < 2005021400) { + table_column("quiz", "", "decimalpoints", "integer", "4", "", "2", "not null", "grademethod"); + } + return true; } diff --git a/mod/quiz/db/mysql.sql b/mod/quiz/db/mysql.sql index eb05ad9618f..92ad4fabb06 100644 --- a/mod/quiz/db/mysql.sql +++ b/mod/quiz/db/mysql.sql @@ -25,6 +25,7 @@ CREATE TABLE `prefix_quiz` ( `feedback` tinyint(4) NOT NULL default '0', `correctanswers` tinyint(4) NOT NULL default '1', `grademethod` tinyint(4) NOT NULL default '1', + `decimalpoints` tinyint(4) NOT NULL default '2', `review` tinyint(4) NOT NULL default '0', `questionsperpage` int(10) NOT NULL default '0', `shufflequestions` tinyint(4) NOT NULL default '0', diff --git a/mod/quiz/db/oci8po.sql b/mod/quiz/db/oci8po.sql index d220b37b260..0946af353b9 100755 --- a/mod/quiz/db/oci8po.sql +++ b/mod/quiz/db/oci8po.sql @@ -21,6 +21,7 @@ CREATE TABLE prefix_quiz ( feedback number(4) default '0' not null, correctanswers number(4) default '1' not null, grademethod number(4) default '1' not null, + decimalpoints number(4) default '2' not null, review number(4) default '0' not null, shufflequestions number(4) default '0' not null, shuffleanswers number(4) default '0' not null, diff --git a/mod/quiz/db/postgres7.php b/mod/quiz/db/postgres7.php index ec51a440701..c8bf93ff864 100644 --- a/mod/quiz/db/postgres7.php +++ b/mod/quiz/db/postgres7.php @@ -295,6 +295,10 @@ function quiz_upgrade($oldversion) { table_column('quiz_grades', 'grade', 'grade', 'real', 2, ''); } + if ($oldversion < 2005021400) { + table_column("quiz", "", "decimalpoints", "integer", "4", "", "2", "not null", "grademethod"); + } + return true; } diff --git a/mod/quiz/db/postgres7.sql b/mod/quiz/db/postgres7.sql index a0723d053ea..d383e72edc3 100644 --- a/mod/quiz/db/postgres7.sql +++ b/mod/quiz/db/postgres7.sql @@ -25,6 +25,7 @@ CREATE TABLE prefix_quiz ( feedback integer NOT NULL default '0', correctanswers integer NOT NULL default '1', grademethod integer NOT NULL default '1', + decimalpoints integer NOT NULL default '2', review integer NOT NULL default '0', questionsperpage integer NOT NULL default '0', shufflequestions integer NOT NULL default '0', diff --git a/mod/quiz/version.php b/mod/quiz/version.php index 446a5db24aa..b14e6870d30 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 = 2005012700; // The (date) version of this module +$module->version = 2005021400; // The (date) version of this module $module->requires = 2005010100; // Requires this Moodle version $module->cron = 0; // How often should cron check this module (seconds)?