From 0f03f3a0c28bee259efeb6639e361f46c937de43 Mon Sep 17 00:00:00 2001 From: gustav_delius Date: Sun, 19 Feb 2006 23:08:52 +0000 Subject: [PATCH] This way around will work better. Sorry, I am tired. --- mod/quiz/db/postgres7.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/mod/quiz/db/postgres7.php b/mod/quiz/db/postgres7.php index 701c2b1ec02..62ac4e0c3ca 100644 --- a/mod/quiz/db/postgres7.php +++ b/mod/quiz/db/postgres7.php @@ -1010,22 +1010,14 @@ function quiz_upgrade($oldversion) { } if ($oldversion < 2006021900) { - // convert grade fields to real - table_column('quiz_attempts', 'sumgrades', 'sumgrades', 'real', '', '', '0', 'not null'); - table_column('quiz_answers', 'fraction', 'fraction', 'real', '', '', '0', 'not null'); - table_column('quiz_essay_states', 'fraction', 'fraction', 'real', '', '', '0', 'not null'); - table_column('quiz_states', 'grade', 'grade', 'real', '', '', '0', 'not null'); - table_column('quiz_states', 'raw_grade', 'raw_grade', 'real', '', '', '0', 'not null'); - table_column('quiz_states', 'penalty', 'penalty', 'real', '', '', '0', 'not null'); - table_column('question_sessions', 'sumpenalty', 'sumpenalty', 'real', '', '', '0', 'not null'); - + modify_database ('', " CREATE TABLE prefix_quiz_essay ( id SERIAL PRIMARY KEY, question integer NOT NULL default '0', answer varchar(255) NOT NULL default '' ) "); - + modify_database ('', " CREATE TABLE `prefix_quiz_essay_states` ( id SERIAL PRIMARY KEY, @@ -1034,6 +1026,15 @@ function quiz_upgrade($oldversion) { fraction varchar(10) NOT NULL default '0.0', response text NOT NULL default '', ) "); + + // convert grade fields to real + table_column('quiz_attempts', 'sumgrades', 'sumgrades', 'real', '', '', '0', 'not null'); + table_column('quiz_answers', 'fraction', 'fraction', 'real', '', '', '0', 'not null'); + table_column('quiz_essay_states', 'fraction', 'fraction', 'real', '', '', '0', 'not null'); + table_column('quiz_states', 'grade', 'grade', 'real', '', '', '0', 'not null'); + table_column('quiz_states', 'raw_grade', 'raw_grade', 'real', '', '', '0', 'not null'); + table_column('quiz_states', 'penalty', 'penalty', 'real', '', '', '0', 'not null'); + table_column('question_sessions', 'sumpenalty', 'sumpenalty', 'real', '', '', '0', 'not null'); } return true;