
--
-- Table structure for table `wiki`
--

CREATE TABLE `wiki` (
  `id` bigint(10) unsigned NOT NULL auto_increment,
  `course` bigint(10) unsigned NOT NULL default '0',
  `name` varchar(255) NOT NULL default '',
  `summary` text NOT NULL,
  `pagename` varchar(255) NOT NULL default '',
  `wtype` enum('teacher','group','student') NOT NULL default 'group',
  `ewikiprinttitle` smallint(4) unsigned NOT NULL default '1',
  `htmlmode` smallint(4) unsigned NOT NULL default '0',
  `ewikiacceptbinary` smallint(4) unsigned NOT NULL default '0',
  `disablecamelcase` smallint(4) unsigned NOT NULL default '0',
  `setpageflags` smallint(4) unsigned NOT NULL default '1',
  `strippages` smallint(4) unsigned NOT NULL default '1',
  `removepages` smallint(4) unsigned NOT NULL default '1',
  `revertchanges` smallint(4) unsigned NOT NULL default '1',
  `initialcontent` varchar(255) NOT NULL default '',
  `timemodified` bigint(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `wiki_cou_ix` (`course`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Main wik table';

--
-- Dumping data for table `wiki`
--


--
-- Table structure for table `wiki_entries`
--

CREATE TABLE `wiki_entries` (
  `id` bigint(10) unsigned NOT NULL auto_increment,
  `wikiid` bigint(10) unsigned NOT NULL default '0',
  `course` bigint(10) unsigned NOT NULL default '0',
  `groupid` bigint(10) unsigned NOT NULL default '0',
  `userid` bigint(10) unsigned NOT NULL default '0',
  `pagename` varchar(255) NOT NULL default '',
  `timemodified` bigint(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `wikientr_cou_ix` (`course`),
  KEY `wikientr_gro_ix` (`groupid`),
  KEY `wikientr_use_ix` (`userid`),
  KEY `wikientr_pag_ix` (`pagename`),
  KEY `wikientr_wik_ix` (`wikiid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Holds entries for each wiki start instance';

--
-- Dumping data for table `wiki_entries`
--


--
-- Table structure for table `wiki_locks`
--

CREATE TABLE `wiki_locks` (
  `id` bigint(10) unsigned NOT NULL auto_increment,
  `wikiid` bigint(10) unsigned NOT NULL,
  `pagename` varchar(160) NOT NULL default '',
  `lockedby` bigint(10) unsigned NOT NULL default '0',
  `lockedsince` bigint(10) unsigned NOT NULL default '0',
  `lockedseen` bigint(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `wikilock_wikpag_uix` (`wikiid`,`pagename`),
  KEY `wikilock_loc_ix` (`lockedseen`),
  KEY `wikilock_wik_ix` (`wikiid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Stores editing locks on Wiki pages';

--
-- Dumping data for table `wiki_locks`
--


--
-- Table structure for table `wiki_pages`
--

CREATE TABLE `wiki_pages` (
  `id` bigint(10) unsigned NOT NULL auto_increment,
  `pagename` varchar(160) NOT NULL default '',
  `version` bigint(10) unsigned NOT NULL default '0',
  `flags` bigint(10) unsigned default '0',
  `content` mediumtext,
  `author` varchar(100) default 'ewiki',
  `userid` bigint(10) unsigned NOT NULL default '0',
  `created` bigint(10) unsigned default '0',
  `lastmodified` bigint(10) unsigned default '0',
  `refs` mediumtext,
  `meta` mediumtext,
  `hits` bigint(10) unsigned default '0',
  `wiki` bigint(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `wikipage_pagverwik_uix` (`pagename`,`version`,`wiki`),
  KEY `wikipage_wik_ix` (`wiki`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Holds the Wiki-Pages';

--
-- Dumping data for table `wiki_pages`
--


--
-- Table structure for table `workshop`
--

CREATE TABLE `workshop` (
  `id` bigint(10) unsigned NOT NULL auto_increment,
  `course` bigint(10) unsigned NOT NULL default '0',
  `name` varchar(255) NOT NULL default '',
  `description` text NOT NULL,
  `wtype` smallint(3) unsigned NOT NULL default '0',
  `nelements` smallint(3) unsigned NOT NULL default '1',
  `nattachments` smallint(3) unsigned NOT NULL default '0',
  `phase` tinyint(2) unsigned NOT NULL default '0',
  `format` tinyint(2) unsigned NOT NULL default '0',
  `gradingstrategy` tinyint(2) unsigned NOT NULL default '1',
  `resubmit` tinyint(2) unsigned NOT NULL default '0',
  `agreeassessments` tinyint(2) unsigned NOT NULL default '0',
  `hidegrades` tinyint(2) unsigned NOT NULL default '0',
  `anonymous` tinyint(2) unsigned NOT NULL default '0',
  `includeself` tinyint(2) unsigned NOT NULL default '0',
  `maxbytes` bigint(10) unsigned NOT NULL default '100000',
  `submissionstart` bigint(10) unsigned NOT NULL default '0',
  `assessmentstart` bigint(10) unsigned NOT NULL default '0',
  `submissionend` bigint(10) unsigned NOT NULL default '0',
  `assessmentend` bigint(10) unsigned NOT NULL default '0',
  `releasegrades` bigint(10) unsigned NOT NULL default '0',
  `grade` smallint(3) NOT NULL default '0',
  `gradinggrade` smallint(3) NOT NULL default '0',
  `ntassessments` smallint(3) unsigned NOT NULL default '0',
  `assessmentcomps` smallint(3) unsigned NOT NULL default '2',
  `nsassessments` smallint(3) unsigned NOT NULL default '0',
  `overallocation` smallint(3) unsigned NOT NULL default '0',
  `timemodified` bigint(10) unsigned NOT NULL default '0',
  `teacherweight` smallint(3) unsigned NOT NULL default '1',
  `showleaguetable` smallint(3) unsigned NOT NULL default '0',
  `usepassword` smallint(3) unsigned NOT NULL default '0',
  `password` varchar(32) NOT NULL default '',
  PRIMARY KEY  (`id`),
  KEY `work_cou_ix` (`course`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Defines workshop';

--
-- Dumping data for table `workshop`
--


--
-- Table structure for table `workshop_assessments`
--

CREATE TABLE `workshop_assessments` (
  `id` bigint(10) unsigned NOT NULL auto_increment,
  `workshopid` bigint(10) unsigned NOT NULL default '0',
  `submissionid` bigint(10) unsigned NOT NULL default '0',
  `userid` bigint(10) unsigned NOT NULL default '0',
  `timecreated` bigint(10) unsigned NOT NULL default '0',
  `timegraded` bigint(10) unsigned NOT NULL default '0',
  `timeagreed` bigint(10) unsigned NOT NULL default '0',
  `grade` double NOT NULL default '0',
  `gradinggrade` smallint(3) NOT NULL default '0',
  `teachergraded` smallint(3) unsigned NOT NULL default '0',
  `mailed` smallint(3) unsigned NOT NULL default '0',
  `resubmission` smallint(3) unsigned NOT NULL default '0',
  `donotuse` smallint(3) unsigned NOT NULL default '0',
  `generalcomment` text NOT NULL,
  `teachercomment` text NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `workasse_use_ix` (`userid`),
  KEY `workasse_mai_ix` (`mailed`),
  KEY `workasse_wor_ix` (`workshopid`),
  KEY `workasse_sub_ix` (`submissionid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Info about assessments by teacher and students';

--
-- Dumping data for table `workshop_assessments`
--


--
-- Table structure for table `workshop_comments`
--

CREATE TABLE `workshop_comments` (
  `id` bigint(10) unsigned NOT NULL auto_increment,
  `workshopid` bigint(10) unsigned NOT NULL default '0',
  `assessmentid` bigint(10) unsigned NOT NULL default '0',
  `userid` bigint(10) unsigned NOT NULL default '0',
  `timecreated` bigint(10) unsigned NOT NULL default '0',
  `mailed` tinyint(2) unsigned NOT NULL default '0',
  `comments` text NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `workcomm_use_ix` (`userid`),
  KEY `workcomm_mai_ix` (`mailed`),
  KEY `workcomm_wor_ix` (`workshopid`),
  KEY `workcomm_ass_ix` (`assessmentid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Defines comments';

--
-- Dumping data for table `workshop_comments`
--


--
-- Table structure for table `workshop_elements`
--

CREATE TABLE `workshop_elements` (
  `id` bigint(10) unsigned NOT NULL auto_increment,
  `workshopid` bigint(10) unsigned NOT NULL default '0',
  `elementno` smallint(3) unsigned NOT NULL default '0',
  `description` text NOT NULL,
  `scale` smallint(3) unsigned NOT NULL default '0',
  `maxscore` smallint(3) unsigned NOT NULL default '1',
  `weight` smallint(3) unsigned NOT NULL default '11',
  `stddev` double NOT NULL default '0',
  `totalassessments` bigint(10) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `workelem_wor_ix` (`workshopid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Info about marking scheme of assignment';

--
-- Dumping data for table `workshop_elements`
--


--
-- Table structure for table `workshop_grades`
--

CREATE TABLE `workshop_grades` (
  `id` bigint(10) unsigned NOT NULL auto_increment,
  `workshopid` bigint(10) unsigned NOT NULL default '0',
  `assessmentid` bigint(10) unsigned NOT NULL default '0',
  `elementno` bigint(10) unsigned NOT NULL default '0',
  `feedback` text NOT NULL,
  `grade` smallint(3) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `workgrad_wor_ix` (`workshopid`),
  KEY `workgrad_ass_ix` (`assessmentid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Info about individual grades given to each element';

--
-- Dumping data for table `workshop_grades`
--


--
-- Table structure for table `workshop_rubrics`
--

CREATE TABLE `workshop_rubrics` (
  `id` bigint(10) unsigned NOT NULL auto_increment,
  `workshopid` bigint(10) unsigned NOT NULL default '0',
  `elementno` bigint(10) unsigned NOT NULL default '0',
  `rubricno` smallint(3) unsigned NOT NULL default '0',
  `description` text NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `workrubr_wor_ix` (`workshopid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Info about the rubrics marking scheme';

--
-- Dumping data for table `workshop_rubrics`
--


--
-- Table structure for table `workshop_stockcomments`
--

CREATE TABLE `workshop_stockcomments` (
  `id` bigint(10) unsigned NOT NULL auto_increment,
  `workshopid` bigint(10) unsigned NOT NULL default '0',
  `elementno` bigint(10) unsigned NOT NULL default '0',
  `comments` text NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `workstoc_wor_ix` (`workshopid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Info about the teacher comment bank';

--
-- Dumping data for table `workshop_stockcomments`
--


--
-- Table structure for table `workshop_submissions`
--

CREATE TABLE `workshop_submissions` (
  `id` bigint(10) unsigned NOT NULL auto_increment,
  `workshopid` bigint(10) unsigned NOT NULL default '0',
  `userid` bigint(10) unsigned NOT NULL default '0',
  `title` varchar(100) NOT NULL default '',
  `timecreated` bigint(10) unsigned NOT NULL default '0',
  `mailed` tinyint(2) unsigned NOT NULL default '0',
  `description` text NOT NULL,
  `gradinggrade` smallint(3) unsigned NOT NULL default '0',
  `finalgrade` smallint(3) unsigned NOT NULL default '0',
  `late` smallint(3) unsigned NOT NULL default '0',
  `nassessments` bigint(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `worksubm_use_ix` (`userid`),
  KEY `worksubm_mai_ix` (`mailed`),
  KEY `worksubm_wor_ix` (`workshopid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Info about submitted work from teacher and students';

--
-- Dumping data for table `workshop_submissions`
--



