From 8f4c2d41e47eb9dc9f5a454b541199cea1fcdcbb Mon Sep 17 00:00:00 2001 From: michaelpenne Date: Mon, 1 Nov 2004 20:44:06 +0000 Subject: [PATCH] added alter table commands to insert useranswer field in lesson_attempts, and added modattempts to lesson and lesson_default tables --- mod/lesson/db/mysql.php | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/mod/lesson/db/mysql.php b/mod/lesson/db/mysql.php index 551bc3096d..a216274662 100644 --- a/mod/lesson/db/mysql.php +++ b/mod/lesson/db/mysql.php @@ -51,22 +51,6 @@ function lesson_upgrade($oldversion) { PRIMARY KEY (`id`) )"); - execute_sql(" create table mdl_lesson_essay - ( id int(10) unsigned not null auto_increment, - lessonid int(10) unsigned not null, - userid int(10) unsigned not null, - pageid int(10) unsigned not null, - answerid int(10) unsigned not null, - try int(10) unsigned not null, - answer text not null, - graded tinyint(3) unsigned not null default 0, - score int(10) unsigned not null default 0, - response text not null, - sent tinyint(3) unsigned not null default 0, - timesubmitted int(10) unsigned not null, - PRIMARY KEY (`id`) - )"); - execute_sql(" create table mdl_lesson_branch ( id int(10) unsigned not null auto_increment, lessonid int(10) unsigned not null, @@ -147,6 +131,19 @@ function lesson_upgrade($oldversion) { PRIMARY KEY (`id`) ) COMMENT = 'Defines lesson_default'"); } + + if ($oldversion < 2004100400) { + execute_sql(" ALTER TABLE `{$CFG->prefix}lesson_attempts` ADD `useranswer` text NOT NULL AFTER correct"); + } + + if ($oldversion < 2004100700) { + execute_sql(" ALTER TABLE `{$CFG->prefix}lesson` ADD `modattempts` tinyint(3) unsigned NOT NULL default '0' AFTER practice"); + } + + if ($oldversion < 2004102600) { + execute_sql(" ALTER TABLE `{$CFG->prefix}lesson_default` ADD `modattempts` tinyint(3) unsigned NOT NULL default '0' AFTER practice"); + } + // CDC-FLAG end -- 2.39.5