Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updates for postges

  • Loading branch information...
commit f739b64d9ba5f1500df3e2b93a75c3fe76bf6fbe 1 parent b0542a1
paca70 authored
Showing with 42 additions and 3 deletions.
  1. +27 −1 mod/workshop/db/postgres7.php
  2. +15 −2 mod/workshop/db/postgres7.sql
View
28 mod/workshop/db/postgres7.php
@@ -67,7 +67,7 @@ function workshop_upgrade($oldversion) {
table_column("workshop", "", "teacherloading", "INTEGER", "4", "unsigned", "5", "NOT NULL", "mailed");
table_column("workshop", "", "assessmentstodrop", "INTEGER", "4", "unsigned", "0", "NOT NULL", "");
table_column("workshop_assessments", "", "donotuse", "INTEGER", "4", "unsigned", "0", "NOT NULL", "resubmission");
- execute_sql("CREATE INDEX {$CFG->prefix}workshop_grades_assesmentid_idx (assessmentid)");
+ execute_sql("CREATE INDEX {$CFG->prefix}workshop_grades_assesmentid_idx ON {$CFG->prefix}workshop_grades (assessmentid)");
}
if ($oldversion < 2004052100) {
@@ -88,6 +88,32 @@ function workshop_upgrade($oldversion) {
execute_sql("ALTER TABLE {$CFG->prefix}workshop DROP COLUMN assessmentstodrop");
}
+ if ($oldversion < 2004092400) {
+ table_column("workshop", "", "nattachments", "INTEGER", "4", "UNSIGNED", "0", "NOT NULL", "nelements");
+ table_column("workshop_submissions", "", "description", "TEXT", "", "", "", "", "mailed");
+ execute_sql("CREATE INDEX {$CFG->prefix}workshop_submissions_userid_idx ON {$CFG->prefix}workshop_submissions (userid)");
+ execute_sql("CREATE INDEX {$CFG->prefix}workshop_assessments_submissionid_idx ON {$CFG->prefix}workshop_assessments (submissionid)");
+ execute_sql("CREATE INDEX {$CFG->prefix}workshop_assessments_userid_idx ON {$CFG->prefix}workshop_assessments (userid)");
+ }
+
+ if ($oldversion < 2004092700) {
+ table_column("workshop", "", "wtype", "INTEGER", "4", "UNSIGNED", "0", "NOT NULL", "description");
+ table_column("workshop", "", "usepassword", "INTEGER", "4", "UNSIGNED", "0", "NOT NULL");
+ table_column("workshop", "", "password", "VARCHAR", "32", "", "", "NOT NULL");
+ table_column("workshop_submissions", "", "late", "INTEGER", "4", "UNSIGNED", "0", "NOT NULL");
+
+ // update wkey value
+ if ($workshops = get_records("workshop")) {
+ foreach ($workshops as $workshop) {
+ $wtype = 0; // 3 phases, no grading grades
+ if ($workshop->includeself or $workshop->ntassessments) $wtype = 1; // 3 phases with grading grades
+ if ($workshop->nsassessments) $wtype = 2; // 5 phases with grading grades
+ set_field("workshop", "wtype", $wtype, "id", $workshop->id);
+ }
+ }
+ }
+
+
return true;
View
17 mod/workshop/db/postgres7.sql
@@ -7,7 +7,9 @@ CREATE TABLE prefix_workshop (
course INT8 NOT NULL default '0',
name varchar(255) NOT NULL default '',
description text NOT NULL default '',
+ wtype INT NOT NULL DEFAULT '0',
nelements INT NOT NULL default '10',
+ nattachments INT NOT NULL DEFAULT '0',
phase INT2 NOT NULL default '0',
format INT2 NOT NULL default '0',
gradingstrategy INT2 NOT NULL default '1',
@@ -26,7 +28,10 @@ CREATE TABLE prefix_workshop (
overallocation INT NOT NULL default '0',
timemodified INT8 NOT NULL default '0',
teacherweight INT NOT NULL default '1',
- showleaguetable INT4 NOT NULL default '0'
+ showleaguetable INT4 NOT NULL default '0',
+ usepassword INT NOT NULL DEFAULT '0',
+ password VARCHAR(32) NOT NULL DEFAULT '0');
+
);
# --------------------------------------------------------
@@ -41,14 +46,19 @@ CREATE TABLE prefix_workshop_submissions (
title varchar(100) NOT NULL default '',
timecreated INT8 NOT NULL default '0',
mailed INT2 NOT NULL default '0',
+ description TEXT
teachergrade INT NOT NULL default '0',
peergrade INT NOT NULL default '0',
biasgrade INT NOT NULL default '0',
reliabilitygrade INT NOT NULL default '0',
gradinggrade INT NOT NULL default '0',
- finalgrade INT NOT NULL default '0'
+ late INT NOT NULL DEFAULT '0');
+
+inalgrade INT NOT NULL default '0'
);
CREATE INDEX prefix_workshop_submissions_title_idx on prefix_workshop_submissions (title);
+CREATE INDEX prefix_workshop_submissions_userid_idx ON prefix_workshop_submissions (userid));
+
# --------------------------------------------------------
#
@@ -73,6 +83,9 @@ CREATE TABLE prefix_workshop_assessments (
);
# --------------------------------------------------------
+CREATE INDEX prefix_workshop_assessments_submissionid_idx ON prefix_workshop_assessments (submissionid);
+CREATE INDEX prefix_workshop_assessments_userid_idx ON prefix_workshop_assessments (userid);
+
#
# Table structure for table workshop_elements
#
Please sign in to comment.
Something went wrong with that request. Please try again.