Permalink
Browse files

Initial version for postgresql.

  • Loading branch information...
1 parent 3f1d9b2 commit 1e57486f1140ba96ca1bccd8d9c11d175503607a paca70 committed Dec 2, 2003
Showing with 214 additions and 0 deletions.
  1. +13 −0 mod/dialogue/db/postgres7.php
  2. +75 −0 mod/dialogue/db/postgres7.sql
  3. +13 −0 mod/exercise/db/postgres7.php
  4. +113 −0 mod/exercise/db/postgres7.sql
@@ -0,0 +1,13 @@
+<?PHP // $Id$
+
+function dialogue_upgrade($oldversion) {
+// This function does anything necessary to upgrade
+// older versions to match current functionality
+
+ global $CFG;
+
+ $result = true;
+ return $result;
+}
+
+?>
@@ -0,0 +1,75 @@
+#
+# A note on the naming convention used in this module:
+#
+# As a Dialogue instance can have a number of Dialogues
+# the fact that a course can have more than one Dialogue
+# instance complicates the nomenclature within the code.
+# We want to easily refer to dialogues within dialogues.
+#
+# For this reason a Dialogue instance is said to have
+# a set of Conversations (not dialogues). So the code
+# (and the table structure here) uses conversations
+# within dialogues. The term "conversation" is just an
+# INTERNAL name and it is NOT used in the user
+# interface. There is NO need to distinguish between
+# dialogue instances and a set of dialogues within one
+# dialogue instance from the point of view of teachers
+# or students point of view.
+
+#
+# Table structure for table dialogue
+#
+
+CREATE TABLE prefix_dialogue (
+ id SERIAL8 PRIMARY KEY,
+ course INT8 NOT NULL default '0',
+ deleteafter INT8 NOT NULL default '14',
+ dialoguetype INT NOT NULL default '0',
+ multipleconversations INT NOT NULL default '0',
+ maildefault INT NOT NULL default '0',
+ timemodified INT8 NOT NULL default '0',
+ name varchar(255) default NULL,
+ intro text
+) ;
+# --------------------------------------------------------
+
+#
+# Table structure for table dialogue_conversations (Virtual Conversations)
+#
+
+CREATE TABLE prefix_dialogue_conversations (
+ id SERIAL8 PRIMARY KEY,
+ dialogueid INT8 NOT NULL default '0',
+ userid INT8 NOT NULL default '0',
+ recipientid INT8 NOT NULL default '0',
+ lastid INT8 NOT NULL default '0',
+ timemodified INT8 NOT NULL default '0',
+ closed INT NOT NULL default '0',
+ seenon INT8 NOT NULL default '0',
+ ctype INT NOT NULL default '0',
+ format INT2 NOT NULL default '0',
+ subject varchar(100) not null default ''
+) ;
+CREATE INDEX prefix_dialogue_conversations_timemodified_idx ON prefix_dialogue_conversations (timemodified) ;
+CREATE INDEX prefix_dialogue_conversations_dialogueid_idx ON prefix_dialogue_conversations (dialogueid) ;
+
+#
+# Table structure for table dialogue_entries
+#
+
+CREATE TABLE prefix_dialogue_entries (
+ id SERIAL8 PRIMARY KEY,
+ dialogueid INT8 NOT NULL default '0',
+ conversationid INT8 NOT NULL default '0',
+ userid INT8 NOT NULL default '0',
+ timecreated INT8 NOT NULL default '0',
+ mailed INT2 NOT NULL default '0',
+ text text NOT NULL
+) ;
+CREATE INDEX prefix_dialogue_entries_conversationid_idx ON prefix_dialogue_entries (conversationid) ;
+
+#
+# Data for the table log_display
+#
+
+INSERT INTO prefix_log_display VALUES ('dialogue', 'view', 'dialogue', 'name');
@@ -0,0 +1,13 @@
+<?PHP // $Id$
+
+function exercise_upgrade($oldversion) {
+// This function does anything necessary to upgrade
+// older versions to match current functionality
+
+ global $CFG;
+
+ return true;
+}
+
+
+?>
@@ -0,0 +1,113 @@
+#
+# Table structure for table exercise
+#
+
+CREATE TABLE prefix_exercise (
+ id SERIAL8 PRIMARY KEY,
+ course INT8 NOT NULL default '0',
+ name varchar(255) NOT NULL default '',
+ nelements INT NOT NULL default '1',
+ phase INT NOT NULL default '0',
+ gradingstrategy INT NOT NULL default '1',
+ usemaximum INT NOT NULL default '0',
+ anonymous INT NOT NULL default '0',
+ maxbytes INT8 NOT NULL default '100000',
+ deadline INT8 NOT NULL default '0',
+ grade INT NOT NULL default '0',
+ timemodified INT8 NOT NULL default '0',
+ teacherweight INT NOT NULL default '5',
+ gradingweight INT NOT NULL default '5',
+ showleaguetable INT NOT NULL default '0'
+);
+# --------------------------------------------------------
+
+#
+# Table structure for table exercise_submissions
+#
+
+CREATE TABLE prefix_exercise_submissions (
+ id SERIAL8 PRIMARY KEY,
+ exerciseid INT8 NOT NULL default '0',
+ userid INT8 NOT NULL default '0',
+ title varchar(100) NOT NULL default '',
+ timecreated INT8 NOT NULL default '0',
+ resubmit INT NOT NULL default '0',
+ mailed INT NOT NULL default '0',
+ isexercise INT NOT NULL default '0'
+);
+CREATE INDEX prefix_exercise_submissions_userid_idx ON prefix_exercise_submissions (userid);
+# --------------------------------------------------------
+
+#
+# Table structure for table exercise_assessments
+#
+
+CREATE TABLE prefix_exercise_assessments (
+ id SERIAL8 PRIMARY KEY,
+ exerciseid INT8 NOT NULL default '0',
+ submissionid INT8 NOT NULL default '0',
+ userid INT8 NOT NULL default '0',
+ timecreated INT8 NOT NULL default '0',
+ timegraded INT8 NOT NULL default '0',
+ grade float NOT NULL default '0',
+ gradinggrade INT NOT NULL default '0',
+ mailed INT2 NOT NULL default '0',
+ generalcomment text NOT NULL,
+ teachercomment text NOT NULL
+ );
+# --------------------------------------------------------
+CREATE INDEX prefix_exercise_assessments_submissionid_idx ON prefix_exercise_assessments (submissionid);
+CREATE INDEX prefix_exercise_assessments_userid_idx ON prefix_exercise_assessments (userid);
+
+# Table structure for table exercise_elements
+#
+
+CREATE TABLE prefix_exercise_elements (
+ id SERIAL8 PRIMARY KEY,
+ exerciseid INT8 NOT NULL default '0',
+ elementno INT NOT NULL default '0',
+ description text NOT NULL,
+ scale INT NOT NULL default '0',
+ maxscore INT NOT NULL default '1',
+ weight INT NOT NULL default '11'
+);
+# --------------------------------------------------------
+
+
+#
+# Table structure for table exercise_rubrics
+#
+
+CREATE TABLE prefix_exercise_rubrics (
+ id SERIAL8 PRIMARY KEY,
+ exerciseid INT8 NOT NULL default '0',
+ elementno INT8 NOT NULL default '0',
+ rubricno INT NOT NULL default '0',
+ description text NOT NULL
+);
+# --------------------------------------------------------
+
+#
+# Table structure for table exercise_grades
+#
+
+CREATE TABLE prefix_exercise_grades (
+ id SERIAL8 PRIMARY KEY,
+ exerciseid INT8 NOT NULL default '0',
+ assessmentid INT8 NOT NULL default '0',
+ elementno INT8 NOT NULL default '0',
+ feedback text NOT NULL default '',
+ grade INT NOT NULL default '0'
+);
+
+CREATE INDEX prefix_exercise_grades_assessmentid_idx ON prefix_exercise_grades (assessmentid);
+# --------------------------------------------------------
+
+
+
+INSERT INTO prefix_log_display VALUES ('exercise', 'close', 'exercise', 'name');
+INSERT INTO prefix_log_display VALUES ('exercise', 'open', 'exercise', 'name');
+INSERT INTO prefix_log_display VALUES ('exercise', 'submit', 'exercise', 'name');
+INSERT INTO prefix_log_display VALUES ('exercise', 'view', 'exercise', 'name');
+INSERT INTO prefix_log_display VALUES ('exercise', 'update', 'exercise', 'name');
+

0 comments on commit 1e57486

Please sign in to comment.