]> git.mjollnir.org Git - moodle.git/commitdiff
Database and upgrade files for PostgreSQL 7 support!
authormoodler <moodler>
Sun, 15 Dec 2002 02:41:07 +0000 (02:41 +0000)
committermoodler <moodler>
Sun, 15 Dec 2002 02:41:07 +0000 (02:41 +0000)
15 files changed:
lib/db/postgres7.sql
mod/assignment/db/postgres7.php [new file with mode: 0644]
mod/assignment/db/postgres7.sql [new file with mode: 0644]
mod/choice/db/postgres7.php [new file with mode: 0644]
mod/choice/db/postgres7.sql [new file with mode: 0755]
mod/forum/db/postgres7.php [new file with mode: 0644]
mod/forum/db/postgres7.sql [new file with mode: 0644]
mod/journal/db/postgres7.php [new file with mode: 0644]
mod/journal/db/postgres7.sql [new file with mode: 0755]
mod/quiz/db/postgres7.php [new file with mode: 0644]
mod/quiz/db/postgres7.sql [new file with mode: 0644]
mod/resource/db/postgres7.php [new file with mode: 0644]
mod/resource/db/postgres7.sql [new file with mode: 0644]
mod/survey/db/postgres7.php [new file with mode: 0644]
mod/survey/db/postgres7.sql [new file with mode: 0755]

index cfb4bdcfba930723a83ef39dcfd1d58731a4bd50..ccf458feb1b047bcf7c7752c0aab28a7e68881eb 100644 (file)
-CREATE TABLE config ( \r
-   id SERIAL PRIMARY KEY,\r
-        name varchar(255) NOT NULL default '',\r
-        value varchar(255) NOT NULL default '',\r
-        CONSTRAINT config_name_uk UNIQUE (name)\r
-);\r
-\r
-CREATE TABLE  course  (\r
-   id  SERIAL PRIMARY KEY,\r
-   category integer   NOT NULL default '0',\r
-   password varchar(50) NOT NULL default '',\r
-   fullname varchar(254) NOT NULL default '',\r
-   shortname varchar(15) NOT NULL default '',\r
-   summary text NOT NULL,\r
-   format varchar(10) CHECK (format IN ('weeks','social','topics')) NOT NULL default 'weeks',\r
-   newsitems integer   NOT NULL default '1',\r
-   teacher varchar(100) NOT NULL default 'Teacher',\r
-   teachers varchar(100) NOT NULL default 'Teachers',\r
-   student varchar(100) NOT NULL default 'Student',\r
-   students varchar(100) NOT NULL default 'Students',\r
-   guest integer   NOT NULL default '0',\r
-   startdate integer   NOT NULL default '0',\r
-   numsections integer   NOT NULL default '1',\r
-   marker integer   NOT NULL default '0',\r
-   timecreated integer   NOT NULL default '0',\r
-   timemodified integer   NOT NULL default '0'\r
-);\r
-\r
-CREATE TABLE  course_categories  (\r
-   id SERIAL PRIMARY KEY,\r
-   name varchar(255) NOT NULL default ''\r
-);\r
-\r
-CREATE TABLE  course_modules  (\r
-   id SERIAL PRIMARY KEY,\r
-   course integer   NOT NULL default '0',\r
-   module integer   NOT NULL default '0',\r
-   instance integer   NOT NULL default '0',\r
-   section integer   NOT NULL default '0',\r
-   added integer   NOT NULL default '0',\r
-   deleted integer   NOT NULL default '0',\r
-   score integer NOT NULL default '0'\r
-);\r
-\r
-CREATE TABLE  course_sections  (\r
-   id SERIAL PRIMARY KEY,\r
-   course  integer   NOT NULL default '0',\r
-   section  integer   NOT NULL default '0',\r
-   summary  text NOT NULL,\r
-   sequence  varchar(255) NOT NULL default ''\r
-);\r
-\r
-CREATE TABLE  log  (\r
-   id SERIAL PRIMARY KEY,\r
-   time  integer   NOT NULL default '0',\r
-   "user"  integer   NOT NULL default '0',\r
-   ip  varchar(15) NOT NULL default '',\r
-   course  integer   NOT NULL default '0',\r
-   module  varchar(10) NOT NULL default '',\r
-   action  varchar(15) NOT NULL default '',\r
-   url  varchar(100) NOT NULL default '',\r
-   info  varchar(255) NOT NULL default ''\r
-);\r
-\r
-CREATE TABLE  log_display  (\r
-   module  varchar(20) NOT NULL default '',\r
-   action  varchar(20) NOT NULL default '',\r
-   mtable  varchar(20) NOT NULL default '',\r
-   field  varchar(40) NOT NULL default ''\r
-);\r
-\r
-CREATE TABLE  modules  (\r
-   id SERIAL PRIMARY KEY,\r
-   name  varchar(20) NOT NULL default '',\r
-   version  integer NOT NULL default '0',\r
-   cron  integer   NOT NULL default '0',\r
-   lastcron  integer   NOT NULL default '0',\r
-   search  varchar(255) NOT NULL default ''\r
-);\r
-\r
-CREATE TABLE  "user"  (\r
-   id SERIAL PRIMARY KEY,\r
-   confirmed  integer NOT NULL default '0',\r
-   username  varchar(100) NOT NULL default '',\r
-   password  varchar(32) NOT NULL default '',\r
-   idnumber  varchar(12) default NULL,\r
-   firstname  varchar(20) NOT NULL default '',\r
-   lastname  varchar(20) NOT NULL default '',\r
-   email  varchar(100) NOT NULL default '',\r
-   icq  varchar(15) default NULL,\r
-   phone1  varchar(20) default NULL,\r
-   phone2  varchar(20) default NULL,\r
-   institution  varchar(40) default NULL,\r
-   department  varchar(30) default NULL,\r
-   address  varchar(70) default NULL,\r
-   city  varchar(20) default NULL,\r
-   country  char(2) default NULL,\r
-   timezone  float NOT NULL default '99',\r
-   firstaccess  integer   NOT NULL default '0',\r
-   lastaccess  integer   NOT NULL default '0',\r
-   lastlogin  integer   NOT NULL default '0',\r
-   currentlogin  integer   NOT NULL default '0',\r
-   lastIP  varchar(15) default NULL,\r
-   secret  varchar(15) default NULL,\r
-   picture  integer default NULL,\r
-   url  varchar(255) default NULL,\r
-   description  text,\r
-   mailformat  integer   NOT NULL default '1',\r
-   maildisplay  integer   NOT NULL default '2',\r
-   timemodified  integer   NOT NULL default '0',\r
-        CONSTRAINT user_username_uk UNIQUE (username)   \r
-);\r
-\r
-CREATE TABLE  user_admins  (\r
-   id SERIAL PRIMARY KEY,\r
-   "user"  integer   NOT NULL default '0'\r
-);\r
-\r
-CREATE TABLE  user_students  (\r
-   id SERIAL PRIMARY KEY,\r
-   "user"  integer   NOT NULL default '0',\r
-   course  integer   NOT NULL default '0',\r
-   "start"  integer   NOT NULL default '0',\r
-   "end"  integer   NOT NULL default '0',\r
-   time  integer   NOT NULL default '0'\r
-);\r
-\r
-CREATE TABLE  user_teachers  (\r
-   id SERIAL PRIMARY KEY,\r
-   "user" integer   NOT NULL default '0',\r
-   course integer   NOT NULL default '0',\r
-   authority integer NOT NULL default '3',\r
-   role varchar(40) NOT NULL default ''\r
-);\r
+CREATE TABLE config (
+   id SERIAL PRIMARY KEY,
+   name varchar(255) NOT NULL default '',
+   value varchar(255) NOT NULL default '',
+   CONSTRAINT config_name_uk UNIQUE (name)
+);
+
+CREATE TABLE course (
+   id SERIAL PRIMARY KEY,
+   category integer NOT NULL default '0',
+   password varchar(50) NOT NULL default '',
+   fullname varchar(254) NOT NULL default '',
+   shortname varchar(15) NOT NULL default '',
+   summary text NOT NULL default '',
+   format varchar(10) CHECK (format IN ('weeks','social','topics')) NOT NULL default 'weeks',
+   modinfo text NOT NULL default '',
+   newsitems integer NOT NULL default '1',
+   teacher varchar(100) NOT NULL default 'Teacher',
+   teachers varchar(100) NOT NULL default 'Teachers',
+   student varchar(100) NOT NULL default 'Student',
+   students varchar(100) NOT NULL default 'Students',
+   guest integer NOT NULL default '0',
+   startdate integer NOT NULL default '0',
+   numsections integer NOT NULL default '1',
+   marker integer NOT NULL default '0',
+   timecreated integer NOT NULL default '0',
+   timemodified integer NOT NULL default '0'
+);
+
+CREATE TABLE course_categories (
+   id SERIAL PRIMARY KEY,
+   name varchar(255) NOT NULL default ''
+);
+
+CREATE TABLE course_modules (
+   id SERIAL PRIMARY KEY,
+   course integer NOT NULL default '0',
+   module integer NOT NULL default '0',
+   instance integer NOT NULL default '0',
+   section integer NOT NULL default '0',
+   added integer NOT NULL default '0',
+   deleted integer NOT NULL default '0',
+   score integer NOT NULL default '0'
+);
+
+CREATE TABLE course_sections (
+   id SERIAL PRIMARY KEY,
+   course integer NOT NULL default '0',
+   section integer NOT NULL default '0',
+   summary text NOT NULL default '',
+   sequence varchar(255) NOT NULL default ''
+);
+
+CREATE TABLE log (
+   id SERIAL PRIMARY KEY,
+   time integer NOT NULL default '0',
+   "user" integer NOT NULL default '0',
+   ip varchar(15) NOT NULL default '',
+   course integer NOT NULL default '0',
+   module varchar(10) NOT NULL default '',
+   action varchar(15) NOT NULL default '',
+   url varchar(100) NOT NULL default '',
+   info varchar(255) NOT NULL default ''
+);
+
+CREATE TABLE log_display (
+   module varchar(20) NOT NULL default '',
+   action varchar(20) NOT NULL default '',
+   mtable varchar(20) NOT NULL default '',
+   field varchar(40) NOT NULL default ''
+);
+
+CREATE TABLE modules (
+   id SERIAL PRIMARY KEY,
+   name varchar(20) NOT NULL default '',
+   version integer NOT NULL default '0',
+   cron integer NOT NULL default '0',
+   lastcron integer NOT NULL default '0',
+   search varchar(255) NOT NULL default ''
+);
+
+CREATE TABLE "user" (
+   id SERIAL PRIMARY KEY,
+   confirmed integer NOT NULL default '0',
+   deleted integer NOT NULL default '0',
+   username varchar(100) NOT NULL default '',
+   password varchar(32) NOT NULL default '',
+   idnumber varchar(12) default NULL,
+   firstname varchar(20) NOT NULL default '',
+   lastname varchar(20) NOT NULL default '',
+   email varchar(100) NOT NULL default '',
+   icq varchar(15) default NULL,
+   phone1 varchar(20) default NULL,
+   phone2 varchar(20) default NULL,
+   institution varchar(40) default NULL,
+   department varchar(30) default NULL,
+   address varchar(70) default NULL,
+   city varchar(20) default NULL,
+   country char(2) default NULL,
+   timezone float NOT NULL default '99',
+   firstaccess integer NOT NULL default '0',
+   lastaccess integer NOT NULL default '0',
+   lastlogin integer NOT NULL default '0',
+   currentlogin integer NOT NULL default '0',
+   lastIP varchar(15) default NULL,
+   secret varchar(15) default NULL,
+   picture integer default NULL,
+   url varchar(255) default NULL,
+   description text,
+   mailformat integer NOT NULL default '1',
+   maildisplay integer NOT NULL default '2',
+   timemodified integer NOT NULL default '0',
+   CONSTRAINT user_username_uk UNIQUE (username)
+);
+
+CREATE TABLE user_admins (
+   id SERIAL PRIMARY KEY,
+   "user" integer NOT NULL default '0'
+);
+
+CREATE TABLE user_students (
+   id SERIAL PRIMARY KEY,
+   "user" integer NOT NULL default '0',
+   course integer NOT NULL default '0',
+   "start" integer NOT NULL default '0',
+   "end" integer NOT NULL default '0',
+   time integer NOT NULL default '0'
+);
+
+CREATE TABLE user_teachers (
+   id SERIAL PRIMARY KEY,
+   "user" integer NOT NULL default '0',
+   course integer NOT NULL default '0',
+   authority integer NOT NULL default '3',
+   role varchar(40) NOT NULL default ''
+);
diff --git a/mod/assignment/db/postgres7.php b/mod/assignment/db/postgres7.php
new file mode 100644 (file)
index 0000000..0c79153
--- /dev/null
@@ -0,0 +1,92 @@
+<?PHP // $Id$
+
+function assignment_upgrade($oldversion) {
+// This function does anything necessary to upgrade
+// older versions to match current functionality
+
+    global $CFG;
+
+    if ($oldversion < 2002080500) {
+
+        execute_sql("
+        CREATE TABLE `assignment` (
+          `id` SERIAL PRIMARY KEY,
+          `course` integer NOT NULL default '0',
+          `name` varchar(255) NOT NULL default '',
+          `description` text NOT NULL,
+          `type` integer NOT NULL default '1',
+          `maxbytes` integer NOT NULL default '100000',
+          `timedue` integer NOT NULL default '0',
+          `grade` integer NOT NULL default '0',
+          `timemodified` integer NOT NULL default '0'
+        )
+        ");
+        
+        execute_sql("
+        CREATE TABLE `assignment_submissions` (
+          `id` integer NOT NULL PRIMARY KEY default '0',
+          `assignment` integer NOT NULL default '0',
+          `user` integer NOT NULL default '0',
+          `timecreated` integer NOT NULL default '0',
+          `timemodified` integer NOT NULL default '0',
+          `numfiles` integer NOT NULL default '0',
+          `grade` integer NOT NULL default '0',
+          `comment` text NOT NULL,
+          `teacher` integer NOT NULL default '0',
+          `timemarked` integer NOT NULL default '0',
+          `mailed` integer NOT NULL default '0'
+        )
+        ");
+        
+        execute_sql(" INSERT INTO log_display VALUES ('assignment', 'view', 'assignment', 'name') ");
+        execute_sql(" INSERT INTO log_display VALUES ('assignment', 'add', 'assignment', 'name') ");
+        execute_sql(" INSERT INTO log_display VALUES ('assignment', 'update', 'assignment', 'name') ");
+        execute_sql(" INSERT INTO log_display VALUES ('assignment', 'view submissions', 'assignment', 'name') ");
+        execute_sql(" INSERT INTO log_display VALUES ('assignment', 'upload', 'assignment', 'name') ");
+    }
+
+    if ($oldversion < 2002080701) {
+        execute_sql(" ALTER TABLE `assignment_submissions` CHANGE `id` `id` SERIAL PRIMARY KEY ");
+    }
+
+    if ($oldversion < 2002082806) {
+        // assignment file area was moved, so rename all the directories in existing courses
+
+        notify("Moving location of assignment files...");
+
+        $basedir = opendir("$CFG->dataroot");
+        while ($dir = readdir($basedir)) {
+            if ($dir == "." || $dir == ".." || $dir == "users") {
+                continue;
+            }
+            if (filetype("$CFG->dataroot/$dir") != "dir") {
+                continue;
+            }
+            $coursedir = "$CFG->dataroot/$dir";
+
+            if (! $coursemoddata = make_mod_upload_directory($dir)) {
+                echo "Error: could not create mod upload directory: $coursemoddata";
+                continue;
+            }
+
+            if (file_exists("$coursedir/assignment")) {
+                if (! rename("$coursedir/assignment", "$coursemoddata/assignment")) {
+                    echo "Error: could not move $coursedir/assignment to $coursemoddata/assignment\n";
+                }
+            }
+        }
+    }
+
+    if ($oldversion < 2002101600) {
+        execute_sql(" ALTER TABLE `assignment` ADD `format` INTEGER DEFAULT '0' NOT NULL AFTER `description` ");
+    }
+    if ($oldversion < 2002110302) {
+        execute_sql(" UPDATE `assignment` SET `type` = '1'");
+    }
+
+    return true;
+}
+
+
+?>
+
diff --git a/mod/assignment/db/postgres7.sql b/mod/assignment/db/postgres7.sql
new file mode 100644 (file)
index 0000000..710caa7
--- /dev/null
@@ -0,0 +1,44 @@
+#
+# Table structure for table assignment
+#
+
+CREATE TABLE assignment (
+  id SERIAL PRIMARY KEY,
+  course integer NOT NULL default '0',
+  name varchar(255) NOT NULL default '',
+  description text NOT NULL default '',
+  format integer NOT NULL default '0',
+  type integer NOT NULL default '1',
+  maxbytes integer NOT NULL default '100000',
+  timedue integer NOT NULL default '0',
+  grade integer NOT NULL default '0',
+  timemodified integer NOT NULL default '0'
+);
+# --------------------------------------------------------
+
+#
+# Table structure for table assignment_submissions
+#
+
+CREATE TABLE assignment_submissions (
+  id SERIAL PRIMARY KEY,
+  assignment integer NOT NULL default '0',
+  "user" integer NOT NULL default '0',
+  timecreated integer NOT NULL default '0',
+  timemodified integer NOT NULL default '0',
+  numfiles integer NOT NULL default '0',
+  grade integer NOT NULL default '0',
+  comment text NOT NULL default '',
+  teacher integer NOT NULL default '0',
+  timemarked integer NOT NULL default '0',
+  mailed integer NOT NULL default '0'
+);
+# --------------------------------------------------------
+
+
+INSERT INTO log_display VALUES ('assignment', 'view', 'assignment', 'name');
+INSERT INTO log_display VALUES ('assignment', 'add', 'assignment', 'name');
+INSERT INTO log_display VALUES ('assignment', 'update', 'assignment', 'name');
+INSERT INTO log_display VALUES ('assignment', 'view submissions', 'assignment', 'name');
+INSERT INTO log_display VALUES ('assignment', 'upload', 'assignment', 'name');
+
diff --git a/mod/choice/db/postgres7.php b/mod/choice/db/postgres7.php
new file mode 100644 (file)
index 0000000..47c741f
--- /dev/null
@@ -0,0 +1,22 @@
+<?PHP // $Id$
+
+function choice_upgrade($oldversion) {
+// This function does anything necessary to upgrade
+// older versions to match current functionality
+
+    if ($oldversion < 2002090800) {
+        execute_sql(" ALTER TABLE `choice` CHANGE `answer1` `answer1` VARCHAR( 255 )");
+        execute_sql(" ALTER TABLE `choice` CHANGE `answer2` `answer2` VARCHAR( 255 )");
+    }
+    if ($oldversion < 2002102400) {
+        execute_sql(" ALTER TABLE `choice` ADD `answer3` varchar(255) NOT NULL AFTER `answer2`");
+        execute_sql(" ALTER TABLE `choice` ADD `answer4` varchar(255) NOT NULL AFTER `answer3`");
+        execute_sql(" ALTER TABLE `choice` ADD `answer5` varchar(255) NOT NULL AFTER `answer4`");
+        execute_sql(" ALTER TABLE `choice` ADD `answer6` varchar(255) NOT NULL AFTER `answer5`");
+    }
+    return true;
+}
+
+
+?>
+
diff --git a/mod/choice/db/postgres7.sql b/mod/choice/db/postgres7.sql
new file mode 100755 (executable)
index 0000000..e93c1e3
--- /dev/null
@@ -0,0 +1,57 @@
+# phpMyAdmin MySQL-Dump
+# version 2.2.1
+# http://phpwizard.net/phpMyAdmin/
+# http://phpmyadmin.sourceforge.net/ (download page)
+#
+# Host: localhost
+# Generation Time: Nov 14, 2001 at 04:44 PM
+# Server version: 3.23.36
+# PHP Version: 4.0.6
+# Database : `moodle`
+# --------------------------------------------------------
+
+#
+# Table structure for table `choice`
+#
+
+CREATE TABLE choice (
+  id SERIAL PRIMARY KEY,
+  course integer NOT NULL default '0',
+  name varchar(255) NOT NULL default '',
+  text text NOT NULL default '',
+  answer1 varchar(255) NOT NULL default 'Yes',
+  answer2 varchar(255) NOT NULL default 'No',
+  answer3 varchar(255) default NULL,
+  answer4 varchar(255) default NULL,
+  answer5 varchar(255) default NULL,
+  answer6 varchar(255) default NULL,
+  timemodified integer NOT NULL default '0'
+);
+
+
+# --------------------------------------------------------
+
+#
+# Table structure for table `choice_answers`
+#
+
+CREATE TABLE choice_answers (
+  id SERIAL PRIMARY KEY,
+  choice integer NOT NULL default '0',
+  "user" integer NOT NULL default '0',
+  answer integer NOT NULL default '0',
+  timemodified integer NOT NULL default '0'
+);
+
+#
+# Dumping data for table `log_display`
+#
+
+INSERT INTO log_display VALUES ('choice', 'view', 'choice', 'name');
+INSERT INTO log_display VALUES ('choice', 'update', 'choice', 'name');
+INSERT INTO log_display VALUES ('choice', 'add', 'choice', 'name');
+INSERT INTO log_display VALUES ('choice', 'report', 'choice', 'name');
+
+    
+
+
diff --git a/mod/forum/db/postgres7.php b/mod/forum/db/postgres7.php
new file mode 100644 (file)
index 0000000..a559323
--- /dev/null
@@ -0,0 +1,60 @@
+<?PHP // $Id$
+
+function forum_upgrade($oldversion) {
+// This function does anything necessary to upgrade
+// older versions to match current functionality
+
+  if ($oldversion < 2002073008) {
+    execute_sql("DELETE FROM modules WHERE name = 'discuss' ");
+    execute_sql("ALTER TABLE `discuss` RENAME `forum_discussions` ");
+    execute_sql("ALTER TABLE `discuss_posts` RENAME `forum_posts` ");
+    execute_sql("ALTER TABLE `discuss_ratings` RENAME `forum_ratings` ");
+    execute_sql("ALTER TABLE `forum` CHANGE `intro` `intro` TEXT NOT NULL ");
+    execute_sql("ALTER TABLE `forum` ADD `forcesubscribe` INTEGER DEFAULT '0' NOT NULL AFTER `assessed`");
+    execute_sql("ALTER TABLE `forum` CHANGE `type` `type` ENUM( 'single', 'news', 'social', 'general', 
+                             'eachuser', 'teacher' ) DEFAULT 'general' NOT NULL ");
+    execute_sql("ALTER TABLE `forum_posts` CHANGE `discuss` `discussion` INT( 10 ) UNSIGNED DEFAULT '0' NOT NULL ");
+    execute_sql("INSERT INTO log_display VALUES ('forum', 'add', 'forum', 'name') ");
+    execute_sql("INSERT INTO log_display VALUES ('forum', 'add discussion', 'forum_discussions', 'name') ");
+    execute_sql("INSERT INTO log_display VALUES ('forum', 'add post', 'forum_posts', 'subject') ");
+    execute_sql("INSERT INTO log_display VALUES ('forum', 'update post', 'forum_posts', 'subject') ");
+    execute_sql("INSERT INTO log_display VALUES ('forum', 'view discussion', 'forum_discussions', 'name') ");
+    execute_sql("DELETE FROM log_display WHERE module = 'discuss' ");
+    execute_sql("UPDATE log SET action = 'view discussion' WHERE module = 'discuss' AND action = 'view' ");
+    execute_sql("UPDATE log SET action = 'add discussion' WHERE module = 'discuss' AND action = 'add' ");
+    execute_sql("UPDATE log SET module = 'forum' WHERE module = 'discuss' ");
+    notify("Renamed all the old discuss tables (now part of forum) and created new forum_types");
+  }
+
+  if ($oldversion < 2002080100) {
+    execute_sql("INSERT INTO log_display VALUES ('forum', 'view subscribers', 'forum', 'name') ");
+    execute_sql("INSERT INTO log_display VALUES ('forum', 'update', 'forum', 'name') ");
+  }
+
+  if ($oldversion < 2002082900) {
+    execute_sql(" ALTER TABLE `forum_posts` ADD `attachment` VARCHAR(100) NOT NULL AFTER `message` ");
+  }
+
+  if ($oldversion < 2002091000) {
+    if (! execute_sql(" ALTER TABLE `forum_posts` ADD `attachment` VARCHAR(100) NOT NULL AFTER `message` ")) {
+      echo "<P>Don't worry about this error - your server already had this upgrade applied";
+    }
+  }
+
+  if ($oldversion < 2002100300) {
+      execute_sql(" ALTER TABLE `forum` CHANGE `open` `open` INTEGER DEFAULT '2' NOT NULL ");
+      execute_sql(" UPDATE `forum` SET `open` = 2 WHERE `open` = 1 ");
+      execute_sql(" UPDATE `forum` SET `open` = 1 WHERE `open` = 0 ");
+  }
+  if ($oldversion < 2002101001) {
+      execute_sql(" ALTER TABLE `forum_posts` ADD `format` INTEGER DEFAULT '0' NOT NULL AFTER `message` ");
+  }
+
+  return true;
+
+}
+
+
+
+?>
+
diff --git a/mod/forum/db/postgres7.sql b/mod/forum/db/postgres7.sql
new file mode 100644 (file)
index 0000000..92d85fc
--- /dev/null
@@ -0,0 +1,91 @@
+#
+# Table structure for table `forum`
+#
+
+CREATE TABLE forum (
+  id SERIAL PRIMARY KEY,
+  course integer NOT NULL default '0',
+  type varchar(10) CHECK (type IN ('single','news','general','social','eachuser','teacher')) NOT NULL default 'general',
+  name varchar(255) NOT NULL default '',
+  intro text NOT NULL default '',
+  open integer NOT NULL default '2',
+  assessed integer NOT NULL default '0',
+  forcesubscribe integer NOT NULL default '0',
+  timemodified integer NOT NULL default '0'
+);
+# --------------------------------------------------------
+
+#
+# Table structure for table `forum_discussions`
+#
+
+CREATE TABLE forum_discussions (
+  id SERIAL PRIMARY KEY,
+  course integer NOT NULL default '0',
+  forum integer NOT NULL default '0',
+  name varchar(255) NOT NULL default '',
+  firstpost integer NOT NULL default '0',
+  assessed integer NOT NULL default '1',
+  timemodified integer NOT NULL default '0'
+);
+# --------------------------------------------------------
+
+#
+# Table structure for table `forum_posts`
+#
+
+CREATE TABLE forum_posts (
+  id SERIAL PRIMARY KEY,
+  discussion integer NOT NULL default '0',
+  parent integer NOT NULL default '0',
+  "user" integer NOT NULL default '0',
+  created integer NOT NULL default '0',
+  modified integer NOT NULL default '0',
+  mailed integer NOT NULL default '0',
+  subject varchar(255) NOT NULL default '',
+  message text NOT NULL default '',
+  format integer NOT NULL default '0',
+  attachment VARCHAR(100) NOT NULL default '',
+  totalscore integer NOT NULL default '0'
+);
+# --------------------------------------------------------
+
+#
+# Table structure for table `forum_ratings`
+#
+
+CREATE TABLE forum_ratings (
+  id SERIAL PRIMARY KEY,
+  "user" integer NOT NULL default '0',
+  post integer NOT NULL default '0',
+  time integer NOT NULL default '0',
+  rating integer NOT NULL default '0'
+);
+# --------------------------------------------------------
+
+#
+# Table structure for table `forum_subscriptions`
+#
+
+CREATE TABLE forum_subscriptions (
+  id SERIAL PRIMARY KEY,
+  "user" integer NOT NULL default '0',
+  forum integer NOT NULL default '0'
+);
+# --------------------------------------------------------
+
+#
+# Dumping data for table `log_display`
+#
+
+INSERT INTO log_display VALUES ('forum', 'add', 'forum', 'name');
+INSERT INTO log_display VALUES ('forum', 'update', 'forum', 'name');
+INSERT INTO log_display VALUES ('forum', 'add discussion', 'forum_discussions', 'name');
+INSERT INTO log_display VALUES ('forum', 'add post', 'forum_posts', 'subject');
+INSERT INTO log_display VALUES ('forum', 'update post', 'forum_posts', 'subject');
+INSERT INTO log_display VALUES ('forum', 'view subscribers', 'forum', 'name');
+INSERT INTO log_display VALUES ('forum', 'view discussion', 'forum_discussions', 'name');
+INSERT INTO log_display VALUES ('forum', 'view forum', 'forum', 'name');
+INSERT INTO log_display VALUES ('forum', 'subscribe', 'forum', 'name');
+INSERT INTO log_display VALUES ('forum', 'unsubscribe', 'forum', 'name');
+
diff --git a/mod/journal/db/postgres7.php b/mod/journal/db/postgres7.php
new file mode 100644 (file)
index 0000000..34c00b7
--- /dev/null
@@ -0,0 +1,19 @@
+<?PHP // $Id$
+
+function journal_upgrade($oldversion) {
+// This function does anything necessary to upgrade
+// older versions to match current functionality
+
+    $result = true;
+
+    if ($oldversion < 20020810) {
+       if (! execute_sql("ALTER TABLE `journal_entries` ADD `mailed` INTEGER DEFAULT '0' NOT NULL")) {
+           $result = false;
+       }
+    }
+    if ($oldversion < 2002101200) {
+       execute_sql(" ALTER TABLE `journal_entries` ADD `format` INTEGER DEFAULT '0' NOT NULL AFTER `text` ");
+    }
+    
+    return $result;
+}
diff --git a/mod/journal/db/postgres7.sql b/mod/journal/db/postgres7.sql
new file mode 100755 (executable)
index 0000000..415410c
--- /dev/null
@@ -0,0 +1,53 @@
+# phpMyAdmin MySQL-Dump
+# version 2.2.1
+# http://phpwizard.net/phpMyAdmin/
+# http://phpmyadmin.sourceforge.net/ (download page)
+#
+# Host: localhost
+# Generation Time: Nov 14, 2001 at 04:44 PM
+# Server version: 3.23.36
+# PHP Version: 4.0.6
+# Database : `moodle`
+# --------------------------------------------------------
+
+#
+# Table structure for table `journal`
+#
+
+CREATE TABLE journal (
+  id SERIAL PRIMARY KEY,
+  course integer NOT NULL default '0',
+  name varchar(255) default NULL,
+  intro text,
+  days integer NOT NULL default '7',
+  assessed integer NOT NULL default '1',
+  timemodified integer NOT NULL default '0'
+);
+# --------------------------------------------------------
+
+#
+# Table structure for table `journal_entries`
+#
+
+CREATE TABLE journal_entries (
+  id SERIAL PRIMARY KEY,
+  journal integer NOT NULL default '0',
+  "user" integer NOT NULL default '0',
+  modified integer NOT NULL default '0',
+  text text NOT NULL default '',
+  format integer NOT NULL default '0',
+  rating integer default '0',
+  comment text,
+  teacher integer NOT NULL default '0',
+  timemarked integer NOT NULL default '0',
+  mailed integer NOT NULL default '0'
+);
+
+#
+# Dumping data for table `log_display`
+#
+
+INSERT INTO log_display VALUES ('journal', 'view', 'journal', 'name');
+INSERT INTO log_display VALUES ('journal', 'add entry', 'journal', 'name');
+INSERT INTO log_display VALUES ('journal', 'update entry', 'journal', 'name');
+INSERT INTO log_display VALUES ('journal', 'view responses', 'journal', 'name');
diff --git a/mod/quiz/db/postgres7.php b/mod/quiz/db/postgres7.php
new file mode 100644 (file)
index 0000000..1fbcf8a
--- /dev/null
@@ -0,0 +1,30 @@
+<?PHP // $Id$
+
+function quiz_upgrade($oldversion) {
+// This function does anything necessary to upgrade
+// older versions to match current functionality
+
+    global $CFG;
+
+    if ($oldversion < 2002101800) {
+        execute_sql(" ALTER TABLE `quiz_attempts` ".
+                    " ADD `timestart` INT(10) UNSIGNED DEFAULT '0' NOT NULL AFTER `sumgrades` , ".
+                    " ADD `timefinish` INT(10) UNSIGNED DEFAULT '0' NOT NULL AFTER `timestart` ");
+        execute_sql(" UPDATE `quiz_attempts` SET timestart = timemodified ");
+        execute_sql(" UPDATE `quiz_attempts` SET timefinish = timemodified ");
+    }
+    if ($oldversion < 2002102101) {
+        execute_sql(" DELETE FROM log_display WHERE module = 'quiz' ");
+        execute_sql(" INSERT INTO log_display VALUES ('quiz', 'view', 'quiz', 'name') ");
+        execute_sql(" INSERT INTO log_display VALUES ('quiz', 'report', 'quiz', 'name') ");
+        execute_sql(" INSERT INTO log_display VALUES ('quiz', 'attempt', 'quiz', 'name') ");
+        execute_sql(" INSERT INTO log_display VALUES ('quiz', 'submit', 'quiz', 'name') ");
+    }
+    if ($oldversion < 2002102600) {
+        execute_sql(" ALTER TABLE `quiz_answers` CHANGE `feedback` `feedback` TEXT NOT NULL ");
+    }
+
+    return true;
+}
+
+?>
diff --git a/mod/quiz/db/postgres7.sql b/mod/quiz/db/postgres7.sql
new file mode 100644 (file)
index 0000000..da2e58f
--- /dev/null
@@ -0,0 +1,173 @@
+# phpMyAdmin MySQL-Dump
+# version 2.3.2-dev
+# http://www.phpmyadmin.net/ (download page)
+#
+# Host: localhost
+# Generation Time: Oct 16, 2002 at 01:12 AM
+# Server version: 3.23.49
+# PHP Version: 4.2.3
+# Database : moodle
+# --------------------------------------------------------
+
+#
+# Table structure for table quiz
+#
+
+CREATE TABLE quiz (
+  id SERIAL PRIMARY KEY,
+  course integer NOT NULL default '0',
+  name varchar(255) NOT NULL default '',
+  intro text NOT NULL default '',
+  timeopen integer NOT NULL default '0',
+  timeclose integer NOT NULL default '0',
+  attempts integer NOT NULL default '0',
+  feedback integer NOT NULL default '0',
+  correctanswers integer NOT NULL default '1',
+  grademethod integer NOT NULL default '1',
+  questions text NOT NULL default '',
+  sumgrades integer NOT NULL default '0',
+  grade integer NOT NULL default '0',
+  timecreated integer NOT NULL default '0',
+  timemodified integer NOT NULL default '0'
+);
+# --------------------------------------------------------
+
+#
+# Table structure for table quiz_answers
+#
+
+CREATE TABLE quiz_answers (
+  id SERIAL PRIMARY KEY,
+  question integer NOT NULL default '0',
+  answer varchar(255) NOT NULL default '',
+  fraction varchar(10) NOT NULL default '0.0',
+  feedback text NOT NULL default ''
+);
+# --------------------------------------------------------
+
+#
+# Table structure for table quiz_attempts
+#
+
+CREATE TABLE quiz_attempts (
+  id SERIAL PRIMARY KEY,
+  quiz integer NOT NULL default '0',
+  "user" integer NOT NULL default '0',
+  attempt integer NOT NULL default '0',
+  sumgrades varchar(10) NOT NULL default '0.0',
+  timestart integer NOT NULL default '0',
+  timefinish integer NOT NULL default '0',
+  timemodified integer NOT NULL default '0'
+);
+# --------------------------------------------------------
+
+#
+# Table structure for table quiz_categories
+#
+
+CREATE TABLE quiz_categories (
+  id SERIAL PRIMARY KEY,
+  course integer NOT NULL default '0',
+  name varchar(255) NOT NULL default '',
+  info text NOT NULL default '',
+  publish integer NOT NULL default '0'
+);
+# --------------------------------------------------------
+
+#
+# Table structure for table quiz_grades
+#
+
+CREATE TABLE quiz_grades (
+  id SERIAL PRIMARY KEY,
+  quiz integer NOT NULL default '0',
+  "user" integer NOT NULL default '0',
+  grade varchar(10) NOT NULL default '0.0',
+  timemodified integer NOT NULL default '0'
+);
+# --------------------------------------------------------
+
+#
+# Table structure for table quiz_multichoice
+#
+
+CREATE TABLE quiz_multichoice (
+  id SERIAL PRIMARY KEY,
+  question integer NOT NULL default '0',
+  layout integer NOT NULL default '0',
+  answers varchar(255) NOT NULL default '',
+  single integer NOT NULL default '0'
+);
+# --------------------------------------------------------
+CREATE INDEX question_quiz_multichoice_idx ON quiz_multichoice (question);
+
+#
+# Table structure for table quiz_question_grades
+#
+
+CREATE TABLE quiz_question_grades (
+  id SERIAL PRIMARY KEY,
+  quiz integer NOT NULL default '0',
+  question integer NOT NULL default '0',
+  grade integer NOT NULL default '0'
+);
+# --------------------------------------------------------
+
+#
+# Table structure for table quiz_questions
+#
+
+CREATE TABLE quiz_questions (
+  id SERIAL PRIMARY KEY,
+  category integer NOT NULL default '0',
+  name varchar(255) NOT NULL default '',
+  questiontext text NOT NULL default '',
+  image varchar(255) NOT NULL default '',
+  type integer NOT NULL default '0'
+);
+# --------------------------------------------------------
+
+#
+# Table structure for table quiz_responses
+#
+
+CREATE TABLE quiz_responses (
+  id SERIAL PRIMARY KEY,
+  attempt integer NOT NULL default '0',
+  question integer NOT NULL default '0',
+  answer varchar(255) NOT NULL default '',
+  grade varchar(10) NOT NULL default '0.0'
+);
+# --------------------------------------------------------
+
+#
+# Table structure for table quiz_shortanswer
+#
+
+CREATE TABLE quiz_shortanswer (
+  id SERIAL PRIMARY KEY,
+  question integer NOT NULL default '0',
+  answers varchar(255) NOT NULL default '',
+  usecase integer NOT NULL default '0'
+);
+# --------------------------------------------------------
+CREATE INDEX question_quiz_shortanswer_idx ON quiz_shortanswer (question);
+
+#
+# Table structure for table quiz_truefalse
+#
+
+CREATE TABLE quiz_truefalse (
+  id SERIAL PRIMARY KEY,
+  question integer NOT NULL default '0',
+  "true" integer NOT NULL default '0',
+  "false" integer NOT NULL default '0'
+);
+CREATE INDEX question_quiz_truefalse_idx ON quiz_truefalse (question);
+
+
+INSERT INTO log_display VALUES ('quiz', 'view', 'quiz', 'name');
+INSERT INTO log_display VALUES ('quiz', 'report', 'quiz', 'name');
+INSERT INTO log_display VALUES ('quiz', 'attempt', 'quiz', 'name');
+INSERT INTO log_display VALUES ('quiz', 'submit', 'quiz', 'name');
+
diff --git a/mod/resource/db/postgres7.php b/mod/resource/db/postgres7.php
new file mode 100644 (file)
index 0000000..0183ddd
--- /dev/null
@@ -0,0 +1,12 @@
+<?PHP // $Id$
+
+function resource_upgrade($oldversion) {
+// This function does anything necessary to upgrade
+// older versions to match current functionality
+
+    return true;
+}
+
+
+?>
+
diff --git a/mod/resource/db/postgres7.sql b/mod/resource/db/postgres7.sql
new file mode 100644 (file)
index 0000000..c0e8fd3
--- /dev/null
@@ -0,0 +1,33 @@
+# phpMyAdmin MySQL-Dump
+# version 2.2.1
+# http://phpwizard.net/phpMyAdmin/
+# http://phpmyadmin.sourceforge.net/ (download page)
+#
+# Host: localhost
+# Generation Time: Nov 14, 2001 at 04:43 PM
+# Server version: 3.23.36
+# PHP Version: 4.0.6
+# Database : `moodle`
+# --------------------------------------------------------
+
+#
+# Table structure for table `resource`
+#
+
+CREATE TABLE resource (
+  id SERIAL PRIMARY KEY,
+  course integer NOT NULL default '0',
+  name varchar(255) NOT NULL default '',
+  type integer NOT NULL default '0',
+  reference varchar(255) default NULL,
+  summary text NOT NULL default '',
+  alltext text NOT NULL default '',
+  timemodified integer NOT NULL default '0'
+);
+
+
+#
+# Dumping data for table `log_display`
+#
+
+INSERT INTO log_display VALUES ('resource', 'view', 'resource', 'name');
diff --git a/mod/survey/db/postgres7.php b/mod/survey/db/postgres7.php
new file mode 100644 (file)
index 0000000..1b0ead6
--- /dev/null
@@ -0,0 +1,160 @@
+<?PHP // $Id$
+
+function survey_upgrade($oldversion) {
+// This function does anything necessary to upgrade
+// older versions to match current functionality
+
+    if ($oldversion < 2002081400) {
+
+        execute_sql("  ALTER TABLE `survey_questions` DROP `owner` ");
+        execute_sql("  ALTER TABLE `survey_questions` ADD `shorttext` VARCHAR(30) NOT NULL AFTER `text` ");
+
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'focus on interesting issues' WHERE id = 1 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'important to my practice' WHERE id = 2 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'improve my practice' WHERE id = 3 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'connects with my practice' WHERE id = 4 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'I\'m critical of my learning' WHERE id = 5 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'I\'m critical of my own ideas' WHERE id = 6 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'I\'m critical of other students' WHERE id = 7 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'I\'m critical of readings' WHERE id = 8 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'I explain my ideas' WHERE id = 9 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'I ask for explanations' WHERE id =10 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'I\'m asked to explain' WHERE id =11 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'students respond to me' WHERE id =12 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'tutor stimulates thinking' WHERE id =13 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'tutor encourages me' WHERE id =14 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'tutor models discourse' WHERE id =15 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'tutor models self-reflection' WHERE id =16 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'students encourage me' WHERE id =17 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'students praise me' WHERE id =18 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'students value me' WHERE id =19 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'student empathise' WHERE id =20 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'I understand other students' WHERE id =21 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'students understand me' WHERE id =22 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'I understand the tutor' WHERE id =23 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'tutor understands me' WHERE id =24 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'Relevance' WHERE id =25 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'Reflective Thinking' WHERE id =26 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'Interactivity' WHERE id =27 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'Tutor Support' WHERE id =28 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'Peer Support' WHERE id =29 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'Interpretation' WHERE id =30 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'Relevance' WHERE id =31 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'Reflective Thinking' WHERE id =32 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'Interactivity' WHERE id =33 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'Tutor Support' WHERE id =34 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = '' WHERE id =35 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = '' WHERE id =36 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = '' WHERE id =37 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = '' WHERE id =38 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = '' WHERE id =39 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = '' WHERE id =40 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = '' WHERE id =41 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = '' WHERE id =42 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = '' WHERE id =43 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = '' WHERE id =44 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'focus quality of argument' WHERE id =45 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'play devil\'s advocate' WHERE id =46 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'where people come from' WHERE id =47 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'understand different people' WHERE id =48 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'interact with variety' WHERE id =49 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'enjoy hearing opinions' WHERE id =50 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'strengthen by argue' WHERE id =51 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'know why people do' WHERE id =52 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'argue with authors' WHERE id =53 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'remain objective' WHERE id =54 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'think WITH people' WHERE id =55 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'use criteria to evaluate' WHERE id =56 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'try to understand' WHERE id =57 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'point out weaknesses' WHERE id =58 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'put myself in their shoes' WHERE id =59 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'putting on trial' WHERE id =60 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'i value logic most' WHERE id =61 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'insight from empathy' WHERE id =62 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'make effort to extend' WHERE id =63 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = 'what\'s wrong\?' WHERE id =64 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = '' WHERE id =65 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = '' WHERE id =66 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = '' WHERE id =67 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = '' WHERE id =68 ");
+        execute_sql("  UPDATE `survey_questions` SET `shorttext` = '' WHERE id =69 ");
+
+    }
+
+    if ($oldversion < 2002110903) {
+        if (! execute_sql("ALTER TABLE `survey_questions` ADD `shorttext` VARCHAR(30) NOT NULL AFTER `text` ")) {
+            notify("If you get an error above, don't worry, just ignore it.  Everything is OK.");
+        }
+
+        execute_sql("UPDATE `survey` SET `name` = 'collesaname', `intro` = 'collesaintro' WHERE name = 'COLLES (Actual)' AND template = 0 ");
+        execute_sql("UPDATE `survey` SET `name` = 'collespname', `intro` = 'collespintro' WHERE name = 'COLLES (Preferred)' AND template = 0");
+        execute_sql("UPDATE `survey` SET `name` = 'collesapname', `intro` = 'collesapintro' WHERE name = 'COLLES (Preferred and Actual)' AND template = 0");
+        execute_sql("UPDATE `survey` SET `name` = 'attlsname', `intro` = 'attlsintro' WHERE name = 'ATTLS (20 item version)' AND template = 0");
+
+        execute_sql("UPDATE `survey_questions` SET `text` = 'colles1', `shorttext` = 'colles1short', `options` = 'scaletimes5' WHERE `shorttext` = 'focus on interesting issues'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'colles2', `shorttext` = 'colles2short', `options` = 'scaletimes5' WHERE `shorttext` = 'important to my practice'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'colles3', `shorttext` = 'colles3short', `options` = 'scaletimes5' WHERE `shorttext` = 'improve my practice'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'colles4', `shorttext` = 'colles4short', `options` = 'scaletimes5' WHERE `shorttext` = 'connects with my practice'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'colles5', `shorttext` = 'colles5short', `options` = 'scaletimes5' WHERE `shorttext` = 'I\'m critical of my learning'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'colles6', `shorttext` = 'colles6short', `options` = 'scaletimes5' WHERE `shorttext` = 'I\'m critical of my own ideas'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'colles7', `shorttext` = 'colles7short', `options` = 'scaletimes5' WHERE `shorttext` = 'I\'m critical of other students'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'colles8', `shorttext` = 'colles8short', `options` = 'scaletimes5' WHERE `shorttext` = 'I\'m critical of readings'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'colles9', `shorttext` = 'colles9short', `options` = 'scaletimes5' WHERE `shorttext` = 'I explain my ideas'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'colles10', `shorttext` = 'colles10short', `options` = 'scaletimes5' WHERE `shorttext` = 'I ask for explanations'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'colles11', `shorttext` = 'colles11short', `options` = 'scaletimes5' WHERE `shorttext` = 'I\'m asked to explain'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'colles12', `shorttext` = 'colles12short', `options` = 'scaletimes5' WHERE `shorttext` = 'students respond to me'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'colles13', `shorttext` = 'colles13short', `options` = 'scaletimes5' WHERE `shorttext` = 'tutor stimulates thinking'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'colles14', `shorttext` = 'colles14short', `options` = 'scaletimes5' WHERE `shorttext` = 'tutor encourages me'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'colles15', `shorttext` = 'colles15short', `options` = 'scaletimes5' WHERE `shorttext` = 'tutor models discourse'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'colles16', `shorttext` = 'colles16short', `options` = 'scaletimes5' WHERE `shorttext` = 'tutor models self-reflection'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'colles17', `shorttext` = 'colles17short', `options` = 'scaletimes5' WHERE `shorttext` = 'students encourage me'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'colles18', `shorttext` = 'colles18short', `options` = 'scaletimes5' WHERE `shorttext` = 'students praise me'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'colles19', `shorttext` = 'colles19short', `options` = 'scaletimes5' WHERE `shorttext` = 'students value me'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'colles20', `shorttext` = 'colles20short', `options` = 'scaletimes5' WHERE `shorttext` = 'student empathise'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'colles21', `shorttext` = 'colles21short', `options` = 'scaletimes5' WHERE `shorttext` = 'I understand other students'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'colles22', `shorttext` = 'colles22short', `options` = 'scaletimes5' WHERE `shorttext` = 'students understand me'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'colles23', `shorttext` = 'colles23short', `options` = 'scaletimes5' WHERE `shorttext` = 'I understand the tutor'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'colles24', `shorttext` = 'colles24short', `options` = 'scaletimes5' WHERE `shorttext` = 'tutor understands me'");
+
+        execute_sql("UPDATE `survey_questions` SET `text` = 'collesm1', `shorttext` = 'collesm1short', `intro` = 'collesmintro', `options` = 'scaletimes5' WHERE `text` = 'Relevance'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'collesm2', `shorttext` = 'collesm2short', `intro` = 'collesmintro', `options` = 'scaletimes5' WHERE `text` = 'Reflective Thinking'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'collesm3', `shorttext` = 'collesm3short', `intro` = 'collesmintro', `options` = 'scaletimes5' WHERE `text` = 'Interactivity'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'collesm4', `shorttext` = 'collesm4short', `intro` = 'collesmintro', `options` = 'scaletimes5' WHERE `text` = 'Tutor Support'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'collesm5', `shorttext` = 'collesm5short', `intro` = 'collesmintro', `options` = 'scaletimes5' WHERE `text` = 'Peer Support'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'collesm6', `shorttext` = 'collesm6short', `intro` = 'collesmintro', `options` = 'scaletimes5' WHERE `text` = 'Interpretation'");
+
+        execute_sql("UPDATE `survey_questions` SET `text` = 'howlong', `options` = 'howlongoptions' WHERE `text` = 'How long did this survey take you to complete\?'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'othercomments' WHERE `text` = 'Do you have any other comments\?'");
+
+        execute_sql("UPDATE `survey_questions` SET `text` = 'attls1', `shorttext` = 'attls1short', `options` = 'scaleagree5' WHERE `shorttext` = 'focus quality of argument'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'attls2', `shorttext` = 'attls2short', `options` = 'scaleagree5' WHERE `shorttext` = 'play devil\'s advocate'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'attls3', `shorttext` = 'attls3short', `options` = 'scaleagree5' WHERE `shorttext` = 'where people come from'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'attls4', `shorttext` = 'attls4short', `options` = 'scaleagree5' WHERE `shorttext` = 'understand different people'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'attls5', `shorttext` = 'attls5short', `options` = 'scaleagree5' WHERE `shorttext` = 'interact with variety'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'attls6', `shorttext` = 'attls6short', `options` = 'scaleagree5' WHERE `shorttext` = 'enjoy hearing opinions'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'attls7', `shorttext` = 'attls7short', `options` = 'scaleagree5' WHERE `shorttext` = 'strengthen by argue'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'attls8', `shorttext` = 'attls8short', `options` = 'scaleagree5' WHERE `shorttext` = 'know why people do'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'attls9', `shorttext` = 'attls9short', `options` = 'scaleagree5' WHERE `shorttext` = 'argue with authors'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'attls10', `shorttext` = 'attls10short', `options` = 'scaleagree5' WHERE `shorttext` = 'remain objective'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'attls11', `shorttext` = 'attls11short', `options` = 'scaleagree5' WHERE `shorttext` = 'think WITH people'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'attls12', `shorttext` = 'attls12short', `options` = 'scaleagree5' WHERE `shorttext` = 'use criteria to evaluate'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'attls13', `shorttext` = 'attls13short', `options` = 'scaleagree5' WHERE `shorttext` = 'try to understand'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'attls14', `shorttext` = 'attls14short', `options` = 'scaleagree5' WHERE `shorttext` = 'point out weaknesses'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'attls15', `shorttext` = 'attls15short', `options` = 'scaleagree5' WHERE `shorttext` = 'put myself in their shoes'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'attls16', `shorttext` = 'attls16short', `options` = 'scaleagree5' WHERE `shorttext` = 'putting on trial'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'attls17', `shorttext` = 'attls17short', `options` = 'scaleagree5' WHERE `shorttext` = 'i value logic most'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'attls18', `shorttext` = 'attls18short', `options` = 'scaleagree5' WHERE `shorttext` = 'insight from empathy'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'attls19', `shorttext` = 'attls19short', `options` = 'scaleagree5' WHERE `shorttext` = 'make effort to extend'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'attls20', `shorttext` = 'attls20short', `options` = 'scaleagree5' WHERE `shorttext` = 'what\'s wrong\?'");
+
+        execute_sql("UPDATE `survey_questions` SET `text` = 'attlsm1', `shorttext` = 'attlsm1', `options` = 'scaleagree5', `intro` = 'attlsmintro' WHERE `text` = 'Attitudes Towards Thinking and Learning'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'attlsm2', `shorttext` = 'attlsm2', `options` = 'scaleagree5', `intro` = 'attlsmintro' WHERE `text` = 'Connected Learning'");
+        execute_sql("UPDATE `survey_questions` SET `text` = 'attlsm3', `shorttext` = 'attlsm3', `options` = 'scaleagree5', `intro` = 'attlsmintro' WHERE `text` = 'Separate Learning'");
+    }
+
+    return true;
+}
+
+
+?>
+
diff --git a/mod/survey/db/postgres7.sql b/mod/survey/db/postgres7.sql
new file mode 100755 (executable)
index 0000000..dfb70f6
--- /dev/null
@@ -0,0 +1,173 @@
+# phpMyAdmin MySQL-Dump
+# version 2.2.1
+# http://phpwizard.net/phpMyAdmin/
+# http://phpmyadmin.sourceforge.net/ (download page)
+#
+# Host: localhost
+# Generation Time: Nov 14, 2001 at 04:39 PM
+# Server version: 3.23.36
+# PHP Version: 4.0.6
+# Database : moodle
+# --------------------------------------------------------
+
+#
+# Table structure for table survey
+#
+
+CREATE TABLE survey (
+  id SERIAL PRIMARY KEY,
+  course integer NOT NULL default '0',
+  template integer NOT NULL default '0',
+  days integer NOT NULL default '0',
+  timecreated integer NOT NULL default '0',
+  timemodified integer NOT NULL default '0',
+  name varchar(255) NOT NULL default '',
+  intro text,
+  questions varchar(255) default NULL
+);
+
+#
+# Dumping data for table survey
+#
+
+INSERT INTO survey (id, course, template, days, timecreated, timemodified, name, intro, questions) VALUES (1, 0, 0, 0, 985017600, 985017600, 'collesaname', 'collesaintro', '25,26,27,28,29,30,43,44');
+INSERT INTO survey (id, course, template, days, timecreated, timemodified, name, intro, questions) VALUES (2, 0, 0, 0, 985017600, 985017600, 'collespname', 'collespintro', '31,32,33,34,35,36,43,44');
+INSERT INTO survey (id, course, template, days, timecreated, timemodified, name, intro, questions) VALUES (3, 0, 0, 0, 985017600, 985017600, 'collesapname', 'collesapintro', '37,38,39,40,41,42,43,44');
+INSERT INTO survey (id, course, template, days, timecreated, timemodified, name, intro, questions) VALUES (4, 0, 0, 0, 985017600, 985017600, 'attlsname', 'attlsintro', '65,67,68');
+
+
+
+#
+# Table structure for table survey_analysis
+#
+
+CREATE TABLE survey_analysis (
+  id SERIAL PRIMARY KEY,
+  survey integer NOT NULL default '0',
+  "user" integer NOT NULL default '0',
+  notes text NOT NULL default ''
+);
+
+#
+# Dumping data for table survey_analysis
+#
+
+# --------------------------------------------------------
+
+#
+# Table structure for table survey_answers
+#
+
+CREATE TABLE survey_answers (
+  id SERIAL PRIMARY KEY,
+  "user" integer NOT NULL default '0',
+  survey integer NOT NULL default '0',
+  question integer NOT NULL default '0',
+  time integer default NULL,
+  answer1 char(255) default NULL,
+  answer2 char(255) default NULL
+);
+
+#
+# Dumping data for table survey_answers
+#
+
+# --------------------------------------------------------
+
+#
+# Table structure for table survey_questions
+#
+
+CREATE TABLE survey_questions (
+  id SERIAL PRIMARY KEY,
+  text varchar(255) NOT NULL default '',
+  shorttext varchar(30) NOT NULL default '',
+  multi varchar(100) NOT NULL default '',
+  intro varchar(50) default NULL,
+  type integer NOT NULL default '0',
+  options text
+);
+
+#
+# Dumping data for table survey_questions
+#
+
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (1, 'colles1', 'colles1short', '', '', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (2, 'colles2', 'colles2short', '', '', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (3, 'colles3', 'colles3short', '', '', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (4, 'colles4', 'colles4short', '', '', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (5, 'colles5', 'colles5short', '', '', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (6, 'colles6', 'colles6short', '', '', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (7, 'colles7', 'colles7short', '', '', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (8, 'colles8', 'colles8short', '', '', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (9, 'colles9', 'colles9short', '', '', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (10, 'colles10', 'colles10short', '', '', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (11, 'colles11', 'colles11short', '', '', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (12, 'colles12', 'colles12short', '', '', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (13, 'colles13', 'colles13short', '', '', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (14, 'colles14', 'colles14short', '', '', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (15, 'colles15', 'colles15short', '', '', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (16, 'colles16', 'colles16short', '', '', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (17, 'colles17', 'colles17short', '', '', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (18, 'colles18', 'colles18short', '', '', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (19, 'colles19', 'colles19short', '', '', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (20, 'colles20', 'colles20short', '', '', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (21, 'colles21', 'colles21short', '', '', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (22, 'colles22', 'colles22short', '', '', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (23, 'colles23', 'colles23short', '', '', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (24, 'colles24', 'colles24short', '', '', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (25, 'collesm1', 'collesm1short', '1,2,3,4', 'collesmintro', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (26, 'collesm2', 'collesm2short', '5,6,7,8', 'collesmintro', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (27, 'collesm3', 'collesm3short', '9,10,11,12', 'collesmintro', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (28, 'collesm4', 'collesm4short', '13,14,15,16', 'collesmintro', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (29, 'collesm5', 'collesm5short', '17,18,19,20', 'collesmintro', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (30, 'collesm6', 'collesm6short', '21,22,23,24', 'collesmintro', 1, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (31, 'collesm1', 'collesm1short', '1,2,3,4', 'collesmintro', 2, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (32, 'collesm2', 'collesm2short', '5,6,7,8', 'collesmintro', 2, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (33, 'collesm3', 'collesm3short', '9,10,11,12', 'collesmintro', 2, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (34, 'collesm4', 'collesm4short', '13,14,15,16', 'collesmintro', 2, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (35, 'collesm5', 'collesm5short', '17,18,19,20', 'collesmintro', 2, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (36, 'collesm6', 'collesm6short', '21,22,23,24', 'collesmintro', 2, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (37, 'collesm1', 'collesm1short', '1,2,3,4', 'collesmintro', 3, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (38, 'collesm2', 'collesm2short', '5,6,7,8', 'collesmintro', 3, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (39, 'collesm3', 'collesm3short', '9,10,11,12', 'collesmintro', 3, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (40, 'collesm4', 'collesm4short', '13,14,15,16', 'collesmintro', 3, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (41, 'collesm5', 'collesm5short', '17,18,19,20', 'collesmintro', 3, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (42, 'collesm6', 'collesm6short', '21,22,23,24', 'collesmintro', 3, 'scaletimes5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (43, 'howlong', '', '', '', 1, 'howlongoptions');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (44, 'othercomments', '', '', '', 0, '');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (64, 'attls20', 'attls20short', '', '', 1, 'scaleagree5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (58, 'attls14', 'attls14short', '', '', 1, 'scaleagree5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (59, 'attls15', 'attls15short', '', '', 1, 'scaleagree5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (60, 'attls16', 'attls16short', '', '', 1, 'scaleagree5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (61, 'attls17', 'attls17short', '', '', 1, 'scaleagree5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (62, 'attls18', 'attls18short', '', '', 1, 'scaleagree5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (63, 'attls19', 'attls19short', '', '', 1, 'scaleagree5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (56, 'attls12', 'attls12short', '', '', 1, 'scaleagree5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (57, 'attls13', 'attls13short', '', '', 1, 'scaleagree5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (55, 'attls11', 'attls11short', '', '', 1, 'scaleagree5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (54, 'attls10', 'attls10short', '', '', 1, 'scaleagree5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (53, 'attls9', 'attls9short', '', '', 1, 'scaleagree5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (52, 'attls8', 'attls8short', '', '', 1, 'scaleagree5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (51, 'attls7', 'attls7short', '', '', 1, 'scaleagree5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (50, 'attls6', 'attls6short', '', '', 1, 'scaleagree5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (49, 'attls5', 'attls5short', '', '', 1, 'scaleagree5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (48, 'attls4', 'attls4short', '', '', 1, 'scaleagree5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (47, 'attls3', 'attls3short', '', '', 1, 'scaleagree5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (45, 'attls1', 'attls1short', '', '', 1, 'scaleagree5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (46, 'attls2', 'attls2short', '', '', 1, 'scaleagree5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (65, 'attlsm1', 'attlsm1', '45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64', 'attlsmintro', 1, 'scaleagree5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (67, 'attlsm2', 'attlsm2', '63,62,59,57,55,49,52,50,48,47', 'attlsmintro', -1, 'scaleagree5');
+INSERT INTO survey_questions (id, text, shorttext, multi, intro, type, options) VALUES (68, 'attlsm3', 'attlsm3', '46,54,45,51,60,53,56,58,61,64', 'attlsmintro', -1, 'scaleagree5');
+
+
+
+#
+# Dumping data for table log_display
+#
+
+INSERT INTO log_display VALUES ('survey', 'download', 'survey', 'name');
+INSERT INTO log_display VALUES ('survey', 'view form', 'survey', 'name');
+INSERT INTO log_display VALUES ('survey', 'view graph', 'survey', 'name');
+INSERT INTO log_display VALUES ('survey', 'view report', 'survey', 'name');
+INSERT INTO log_display VALUES ('survey', 'submit', 'survey', 'name');