USE `econexperiments2`;

--
-- Table structure for table `chat`
--

-- DROP TABLE IF EXISTS `econexperiments2`.`chat`;

CREATE TABLE IF NOT EXISTS `econexperiments2`.`chat` 
(
  `chatID` int NOT NULL AUTO_INCREMENT,
  `userID` int DEFAULT NULL,
  `message` varchar(10240) DEFAULT NULL,
  `msgTime` datetime DEFAULT NULL,
  `IPAddress` varchar(16) DEFAULT NULL,
  PRIMARY KEY (`chatID`)
) ENGINE=InnoDB AUTO_INCREMENT=21475 DEFAULT CHARSET=latin1;


--
-- Table structure for table `callmarketexpsettings`
--

-- DROP TABLE IF EXISTS `econexperiments2`.`callmarketexpsettings`;

CREATE TABLE IF NOT EXISTS `econexperiments2`.`callmarketexpsettings` 
(
  `UniqID` int unsigned NOT NULL AUTO_INCREMENT,
  `ExperimentID` varchar(45) NOT NULL,
  `RMax` decimal(5,2) NOT NULL,
  `Time_for_Round` int unsigned NOT NULL,
  `Num_of_Rounds` int unsigned NOT NULL,
  `Inter_Degree` varchar(45) NOT NULL,
  `ExperimentTitle` varchar(45) DEFAULT NULL,
  `CourseID` varchar(45) NOT NULL,
  PRIMARY KEY (`UniqID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;


--
-- Table structure for table `callmarketexpdata`
--

-- DROP TABLE IF EXISTS `econexperiments2`.`callmarketexpdata`;

CREATE TABLE IF NOT EXISTS `econexperiments2`.`callmarketexpdata` 
(
  `UniqKey` int unsigned NOT NULL AUTO_INCREMENT,
  `ExperimentID` varchar(45) NOT NULL,
  `UserID` int unsigned NOT NULL,
  `RoundNum` int unsigned NOT NULL,
  `Unit_Value_Cost` decimal(5,2) NOT NULL,
  `Unit_Bid_Ask` decimal(5,2) NOT NULL,
  `EquilibriumPrice` decimal(5,2) NOT NULL,
  `AccumValue` decimal(5,2) NOT NULL,
  `UserName` varchar(45) NOT NULL,
  `Cons_Prod_Surplus` decimal(5,2) NOT NULL,
  PRIMARY KEY (`UniqKey`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;



--
-- Table structure for table `callmarketbidask`
--

-- DROP TABLE IF EXISTS `econexperiments2`.`callmarketbidask`;

CREATE TABLE IF NOT EXISTS `econexperiments2`.`callmarketbidask` 
(
  `Bid_AskID` int NOT NULL AUTO_INCREMENT,
  `ExperimentID` varchar(45) NOT NULL,
  `UserID` int unsigned NOT NULL,
  `Bid_Ask` decimal(5,2) NOT NULL,
  `UserName` varchar(45) NOT NULL,
  `GotData` int unsigned DEFAULT NULL,
  PRIMARY KEY (`Bid_AskID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;



--
-- Table structure for table `bidask`
--

-- DROP TABLE IF EXISTS `econexperiments2`.`bidask`;

CREATE TABLE IF NOT EXISTS `econexperiments2`.`bidask` 
(
  `bidaskID` int NOT NULL AUTO_INCREMENT,
  `bidaskTime` datetime DEFAULT NULL,
  `bidaskType` int DEFAULT NULL,
  `bidaskPrice` float DEFAULT NULL,
  `bidaskInitialPrice` float DEFAULT NULL,
  `bidaskUserID` int DEFAULT NULL,
  `bidaskRoomID` varchar(255) DEFAULT NULL,
  `bidaskOpenTime` int DEFAULT NULL,
  `bidaskCloseTime` int DEFAULT NULL,
  `transactionPrice` float DEFAULT NULL,
  `transactionWithUserID` int DEFAULT NULL,
  `roundNumber` int DEFAULT NULL,
  `reservationPrice` float DEFAULT NULL,
  `active` tinyint DEFAULT '1',
  PRIMARY KEY (`bidaskID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;



--
-- Table structure for table `asyncResultsPublicGoods`
--

-- DROP TABLE IF EXISTS `econexperiments2`.`asyncResultsPublicGoods`;

CREATE TABLE IF NOT EXISTS `econexperiments2`.`asyncResultsPublicGoods` 
(
  `id` int NOT NULL AUTO_INCREMENT,
  `active` tinyint NOT NULL DEFAULT '1',
  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `pearsonUserID` varchar(255) DEFAULT NULL,
  `isEducator` tinyint DEFAULT NULL,
  `variant` varchar(10) DEFAULT NULL,
  `courseID` varchar(511) DEFAULT NULL,
  `resultID` varchar(255) DEFAULT NULL,
  `attemptID` int DEFAULT NULL,
  `attemptMode` varchar(50) DEFAULT NULL,
  `roundNumber` int DEFAULT NULL,
  `fullName` varchar(255) DEFAULT NULL,
  `extra` varchar(10) DEFAULT NULL,
  `restoreData` mediumtext,
  `score` float DEFAULT NULL,
  `relativeGains` float DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=14623 DEFAULT CHARSET=latin1;



--
-- Table structure for table `asyncResultsLemons`
--

-- DROP TABLE IF EXISTS `econexperiments2`.`asyncResultsLemons`;

CREATE TABLE IF NOT EXISTS `econexperiments2`.`asyncResultsLemons` 
(
  `id` int NOT NULL AUTO_INCREMENT,
  `active` tinyint NOT NULL DEFAULT '1',
  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `pearsonUserID` varchar(255) DEFAULT NULL,
  `isEducator` tinyint DEFAULT NULL,
  `variant` varchar(10) DEFAULT NULL,
  `courseID` varchar(511) DEFAULT NULL,
  `resultID` varchar(255) DEFAULT NULL,
  `attemptID` int DEFAULT NULL,
  `attemptMode` varchar(50) DEFAULT NULL,
  `roundNumber` int DEFAULT NULL,
  `fullName` varchar(255) DEFAULT NULL,
  `extra` varchar(10) DEFAULT NULL,
  `restoreData` mediumtext,
  `score` float DEFAULT NULL,
  `relativeGains` float DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=13842 DEFAULT CHARSET=latin1;



--
-- Table structure for table `asyncResults`
--

-- DROP TABLE IF EXISTS `econexperiments2`.`asyncResults`;
CREATE TABLE IF NOT EXISTS `econexperiments2`.`asyncResults` 
(
  `id` int NOT NULL AUTO_INCREMENT,
  `active` tinyint NOT NULL DEFAULT '1',
  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `pearsonUserID` varchar(255) DEFAULT NULL,
  `isEducator` tinyint DEFAULT NULL,
  `variant` varchar(10) DEFAULT NULL,
  `courseID` varchar(511) DEFAULT NULL,
  `resultID` varchar(255) DEFAULT NULL,
  `attemptID` int DEFAULT NULL,
  `attemptMode` varchar(50) DEFAULT NULL,
  `roundNumber` int DEFAULT NULL,
  `fullName` varchar(255) DEFAULT NULL,
  `role` varchar(10) DEFAULT NULL,
  `wtp` varchar(10) DEFAULT NULL,
  `cost` varchar(10) DEFAULT NULL,
  `bid` varchar(10) DEFAULT NULL,
  `ask` varchar(10) DEFAULT NULL,
  `transactionPrice` varchar(10) DEFAULT NULL,
  `actualGain` varchar(10) DEFAULT NULL,
  `eqPrice` varchar(10) DEFAULT NULL,
  `potentialGain` varchar(10) DEFAULT NULL,
  `relativeGain` varchar(255) DEFAULT NULL,
  `participation` varchar(11) DEFAULT NULL,
  `score` float DEFAULT NULL,
  `extra` varchar(10) DEFAULT NULL,
  `restoreData` mediumtext,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=537068 DEFAULT CHARSET=latin1;



-- DROP TABLE IF EXISTS `econexperiments2`.`asyncAssessmentSummaries`;

CREATE TABLE IF NOT EXISTS `econexperiments2`.`asyncAssessmentSummaries` 
(
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `pearsonUserID` varchar(255) DEFAULT NULL,
  `isEducator` tinyint DEFAULT NULL,
  `variant` varchar(10) DEFAULT NULL,
  `courseID` varchar(511) DEFAULT NULL,
  `resultID` varchar(255) DEFAULT NULL,
  `attemptID` int DEFAULT NULL,
  `attemptMode` varchar(50) DEFAULT NULL,
  `active` tinyint DEFAULT NULL,
  `summary` text,
  `score` float DEFAULT NULL,
  `relativeGains` float DEFAULT NULL,
  `possiblePoints` float DEFAULT NULL,
  `useScale` tinyint(1) DEFAULT NULL,
  `adjustedRelativeGain` float DEFAULT NULL,
  PRIMARY KEY (`id`)
) 
ENGINE=MyISAM AUTO_INCREMENT=55513 DEFAULT CHARSET=latin1;



--
-- Table structure for table `tempAsyncResults`
--

-- DROP TABLE IF EXISTS `econexperiments2`.`tempAsyncResults`;

CREATE TABLE IF NOT EXISTS `econexperiments2`.`tempAsyncResults` 
(
  `id` int NOT NULL AUTO_INCREMENT,
  `startDate` timestamp NULL DEFAULT NULL,
  `updatedDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `pearsonUserID` varchar(255) DEFAULT NULL,
  `isEducator` tinyint DEFAULT NULL,
  `variant` varchar(10) DEFAULT NULL,
  `courseID` varchar(511) DEFAULT NULL,
  `fullName` varchar(255) DEFAULT NULL,
  `roundNumber` int DEFAULT NULL,
  `isCompleted` tinyint NOT NULL DEFAULT '0',
  `restoreData` mediumtext,
  `miscInfo` mediumtext,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=101722 DEFAULT CHARSET=latin1;


--
-- Table structure for table `teacherlist`
--

-- DROP TABLE IF EXISTS `econexperiments2`.`teacherlist`;

CREATE TABLE IF NOT EXISTS `econexperiments2`.`teacherlist` 
(
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `fullName` varchar(255) DEFAULT NULL,
  `exists` int DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8588 DEFAULT CHARSET=latin1;

--
-- Table structure for table `settings`
--

-- DROP TABLE IF EXISTS `econexperiments2`.`settings`;

CREATE TABLE IF NOT EXISTS `econexperiments2`.`settings`
(
  `id` int NOT NULL AUTO_INCREMENT,
  `userId` int NOT NULL,
  `isEducator` tinyint DEFAULT NULL,
  `courseId` varchar(255) NOT NULL,
  `application` varchar(255) NOT NULL,
  `data` text NOT NULL,
  `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2328 DEFAULT CHARSET=latin1;



--
-- Table structure for table `roundData`
--

-- DROP TABLE IF EXISTS `econexperiments2`.`roundData`;

CREATE TABLE IF NOT EXISTS `econexperiments2`.`roundData` 
(
  `id` int NOT NULL AUTO_INCREMENT,
  `courseID` varchar(255) DEFAULT NULL,
  `roundNumber` int DEFAULT NULL,
  `userID` int DEFAULT NULL,
  `userRole` int DEFAULT NULL,
  `userWTP` float DEFAULT NULL,
  `userCost` float DEFAULT NULL,
  `active` tinyint DEFAULT NULL,
  `dateTime` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=36499 DEFAULT CHARSET=latin1;


--
-- Table structure for table `publicgoodparticipant`
--

-- DROP TABLE IF EXISTS `econexperiments2`.`publicgoodparticipant`;

CREATE TABLE IF NOT EXISTS `econexperiments2`.`publicgoodparticipant` 
(
  `UniqueID` int unsigned NOT NULL AUTO_INCREMENT,
  `ExperimentID` varchar(45) NOT NULL,
  `UserID` int unsigned NOT NULL,
  `CumulativeEarnings` decimal(5,2) NOT NULL,
  `GroupNum` int unsigned NOT NULL,
  `Status` varchar(45) NOT NULL DEFAULT 'dormant',
  `PPtsTreat1Allotted` int unsigned NOT NULL DEFAULT '0',
  `PPtsTreat1Penalty` int unsigned NOT NULL DEFAULT '0',
  `PPtsTreat2Allotted` int unsigned NOT NULL DEFAULT '0',
  `PPtsTreat2Penalty` int unsigned NOT NULL DEFAULT '0',
  `PPtsTreat3Allotted` int unsigned NOT NULL DEFAULT '0',
  `PPtsTreat3Penalty` int unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`UniqueID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


--
-- Table structure for table `publicgoodexpsettings`
--

-- DROP TABLE IF EXISTS `econexperiments2`.`publicgoodexpsettings`;

CREATE TABLE IF NOT EXISTS `econexperiments2`.`publicgoodexpsettings` 
(
  `UniqID` int unsigned NOT NULL AUTO_INCREMENT,
  `ExperimentID` varchar(45) NOT NULL,
  `ExperimentTitle` varchar(45) DEFAULT NULL,
  `CourseID` varchar(45) DEFAULT NULL,
  `ClassSize` int unsigned DEFAULT NULL,
  `GroupSize` int unsigned DEFAULT NULL,
  `NumOfTreatments` int unsigned DEFAULT NULL,
  `Treat1NumRounds` int unsigned DEFAULT NULL,
  `Treat1PunPoints` int unsigned DEFAULT NULL,
  `Treat1CostToReceive` decimal(5,2) DEFAULT NULL,
  `Treat1CostToSend` decimal(5,2) DEFAULT NULL,
  `Treat2NumRounds` int unsigned DEFAULT NULL,
  `Treat2PunPoints` int unsigned DEFAULT NULL,
  `Treat2CostToReceive` decimal(5,2) DEFAULT NULL,
  `Treat2CostToSend` decimal(5,2) DEFAULT NULL,
  `Treat3NumRounds` int unsigned DEFAULT NULL,
  `Treat3PunPoints` int unsigned DEFAULT NULL,
  `Treat3CostToReceive` decimal(5,2) DEFAULT NULL,
  `Treat3CostToSend` decimal(5,2) DEFAULT NULL,
  PRIMARY KEY (`UniqID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


--
-- Table structure for table `publicgoodexpdata`
--

-- DROP TABLE IF EXISTS `econexperiments2`.`publicgoodexpdata`;

CREATE TABLE IF NOT EXISTS `econexperiments2`.`publicgoodexpdata` 
(
  `UniqID` int unsigned NOT NULL AUTO_INCREMENT,
  `ExperimentID` varchar(45) NOT NULL,
  `UserID` int unsigned NOT NULL,
  `TreatNum` int unsigned NOT NULL,
  `RoundNum` int unsigned NOT NULL,
  `TokensInvested` int unsigned NOT NULL,
  `Name` varchar(45) NOT NULL,
  `GroupNum` int unsigned NOT NULL DEFAULT '0',
  `PendingSubmit` int unsigned NOT NULL DEFAULT '0',
  `PunAllotted` int unsigned DEFAULT NULL,
  `PunPenalty` int unsigned DEFAULT NULL,
  `Earnings` decimal(5,2) NOT NULL DEFAULT '0.00',
  PRIMARY KEY (`UniqID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


