From fd790dfb5585856dbd066550376d3a2bd27c8cf7 Mon Sep 17 00:00:00 2001 From: moodler Date: Sun, 15 Dec 2002 02:41:07 +0000 Subject: [PATCH] Database and upgrade files for PostgreSQL 7 support! --- lib/db/postgres7.sql | 270 ++++++++++++++++---------------- mod/assignment/db/postgres7.php | 92 +++++++++++ mod/assignment/db/postgres7.sql | 44 ++++++ mod/choice/db/postgres7.php | 22 +++ mod/choice/db/postgres7.sql | 57 +++++++ mod/forum/db/postgres7.php | 60 +++++++ mod/forum/db/postgres7.sql | 91 +++++++++++ mod/journal/db/postgres7.php | 19 +++ mod/journal/db/postgres7.sql | 53 +++++++ mod/quiz/db/postgres7.php | 30 ++++ mod/quiz/db/postgres7.sql | 173 ++++++++++++++++++++ mod/resource/db/postgres7.php | 12 ++ mod/resource/db/postgres7.sql | 33 ++++ mod/survey/db/postgres7.php | 160 +++++++++++++++++++ mod/survey/db/postgres7.sql | 173 ++++++++++++++++++++ 15 files changed, 1155 insertions(+), 134 deletions(-) create mode 100644 mod/assignment/db/postgres7.php create mode 100644 mod/assignment/db/postgres7.sql create mode 100644 mod/choice/db/postgres7.php create mode 100755 mod/choice/db/postgres7.sql create mode 100644 mod/forum/db/postgres7.php create mode 100644 mod/forum/db/postgres7.sql create mode 100644 mod/journal/db/postgres7.php create mode 100755 mod/journal/db/postgres7.sql create mode 100644 mod/quiz/db/postgres7.php create mode 100644 mod/quiz/db/postgres7.sql create mode 100644 mod/resource/db/postgres7.php create mode 100644 mod/resource/db/postgres7.sql create mode 100644 mod/survey/db/postgres7.php create mode 100755 mod/survey/db/postgres7.sql diff --git a/lib/db/postgres7.sql b/lib/db/postgres7.sql index cfb4bdcfba..ccf458feb1 100644 --- a/lib/db/postgres7.sql +++ b/lib/db/postgres7.sql @@ -1,134 +1,136 @@ -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, - format varchar(10) CHECK (format IN ('weeks','social','topics')) NOT NULL default 'weeks', - 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, - 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', - 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 '' -); +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 index 0000000000..0c791534c3 --- /dev/null +++ b/mod/assignment/db/postgres7.php @@ -0,0 +1,92 @@ +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 index 0000000000..710caa7183 --- /dev/null +++ b/mod/assignment/db/postgres7.sql @@ -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 index 0000000000..47c741f552 --- /dev/null +++ b/mod/choice/db/postgres7.php @@ -0,0 +1,22 @@ + + diff --git a/mod/choice/db/postgres7.sql b/mod/choice/db/postgres7.sql new file mode 100755 index 0000000000..e93c1e36e1 --- /dev/null +++ b/mod/choice/db/postgres7.sql @@ -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 index 0000000000..a5593235c6 --- /dev/null +++ b/mod/forum/db/postgres7.php @@ -0,0 +1,60 @@ +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 index 0000000000..92d85fc690 --- /dev/null +++ b/mod/forum/db/postgres7.sql @@ -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 index 0000000000..34c00b7fc0 --- /dev/null +++ b/mod/journal/db/postgres7.php @@ -0,0 +1,19 @@ + diff --git a/mod/quiz/db/postgres7.sql b/mod/quiz/db/postgres7.sql new file mode 100644 index 0000000000..da2e58ffd3 --- /dev/null +++ b/mod/quiz/db/postgres7.sql @@ -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 index 0000000000..0183dddee0 --- /dev/null +++ b/mod/resource/db/postgres7.php @@ -0,0 +1,12 @@ + + diff --git a/mod/resource/db/postgres7.sql b/mod/resource/db/postgres7.sql new file mode 100644 index 0000000000..c0e8fd33ed --- /dev/null +++ b/mod/resource/db/postgres7.sql @@ -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 index 0000000000..1b0ead621c --- /dev/null +++ b/mod/survey/db/postgres7.php @@ -0,0 +1,160 @@ + + diff --git a/mod/survey/db/postgres7.sql b/mod/survey/db/postgres7.sql new file mode 100755 index 0000000000..dfb70f6ede --- /dev/null +++ b/mod/survey/db/postgres7.sql @@ -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'); -- 2.39.5