questionnaire


(mysql): CREATE TABLE `mdl_questionnaire` ( `id` int(11) NOT NULL auto_increment, `course` int(11) NOT NULL default '0', `name` varchar(255) NOT NULL default '', `summary` text NOT NULL, `qtype` INT( 10 ) NOT NULL default 0, `respondenttype` enum('fullname','anonymous') NOT NULL DEFAULT 'fullname', `resp_eligible` enum( 'all', 'students', 'teachers' ) NOT NULL DEFAULT 'all', `resp_view` INT( 2 ) NOT NULL default 0, `opendate` INT( 10 ) NOT NULL, `closedate` INT( 10 ) NOT NULL, `resume` INT( 2 ) NOT NULL default '0', `navigate` INT( 2 ) NOT NULL default '0', `sid` int(11) NOT NULL default '0', `timemodified` int(10) NOT NULL default '0', PRIMARY KEY (`id`), KEY `sid` (`sid`)) TYPE=MyISAM  
Success


(mysql): CREATE TABLE `mdl_questionnaire_attempts` ( `id` int(11) NOT NULL auto_increment, `qid` int(11) NOT NULL default '0', `userid` int(11) NOT NULL default '0', `rid` int(10) unsigned NOT NULL default '0', `timemodified` int(10) NOT NULL default '0', PRIMARY KEY (`id`)) TYPE=MyISAM  
Success


(mysql): CREATE TABLE mdl_questionnaire_survey ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, name CHAR(64) NOT NULL, owner CHAR(16) NOT NULL, realm CHAR(64) NOT NULL, public ENUM('Y','N') NOT NULL DEFAULT 'Y', status INT UNSIGNED NOT NULL DEFAULT '0', title CHAR(255) NOT NULL, email CHAR(64), subtitle TEXT, info TEXT, theme CHAR(64), thanks_page CHAR(255), thank_head CHAR(255), thank_body TEXT, changed TIMESTAMP(14) NOT NULL, PRIMARY KEY (id), KEY `name` (`name`), KEY `owner` (`owner`))  
Success


(mysql): CREATE TABLE mdl_questionnaire_question_type ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, type CHAR(32) NOT NULL, has_choices ENUM('Y','N') NOT NULL, response_table CHAR(32) NOT NULL, PRIMARY KEY (id))  
Success


(mysql): CREATE TABLE mdl_questionnaire_question ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, survey_id INT UNSIGNED NOT NULL, name CHAR(30) NOT NULL, type_id INT UNSIGNED NOT NULL, result_id INT UNSIGNED, length INT NOT NULL DEFAULT 0, precise INT NOT NULL DEFAULT 0, position INT UNSIGNED NOT NULL, content TEXT NOT NULL, required ENUM('Y','N') NOT NULL DEFAULT 'N', deleted ENUM('Y','N') NOT NULL DEFAULT 'N', public ENUM('Y','N') NOT NULL DEFAULT 'Y', PRIMARY KEY (id))  
Success


(mysql): CREATE TABLE mdl_questionnaire_question_choice ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, question_id INT UNSIGNED NOT NULL, content TEXT NOT NULL, value TEXT, PRIMARY KEY (id))  
Success


(mysql): CREATE TABLE mdl_questionnaire_response ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, survey_id INT UNSIGNED NOT NULL, submitted INT(10) UNSIGNED NOT NULL DEFAULT 0, complete ENUM('Y','N') NOT NULL DEFAULT 'N', username CHAR(64), PRIMARY KEY (id))  
Success


(mysql): CREATE TABLE mdl_questionnaire_response_bool ( `id` int(11) NOT NULL auto_increment, response_id INT UNSIGNED NOT NULL, question_id INT UNSIGNED NOT NULL, choice_id ENUM('Y','N') NOT NULL, PRIMARY KEY (id), KEY response_question (response_id,question_id))  
Success


(mysql): CREATE TABLE mdl_questionnaire_response_single ( `id` int(11) NOT NULL auto_increment, response_id INT UNSIGNED NOT NULL, question_id INT UNSIGNED NOT NULL, choice_id INT UNSIGNED NOT NULL, PRIMARY KEY (id), KEY response_question (response_id,question_id))  
Success


(mysql): CREATE TABLE mdl_questionnaire_response_multiple ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, response_id INT UNSIGNED NOT NULL, question_id INT UNSIGNED NOT NULL, choice_id INT UNSIGNED NOT NULL, PRIMARY KEY(id))  
Success


(mysql): CREATE TABLE mdl_questionnaire_response_rank ( `id` int(11) NOT NULL auto_increment, response_id INT UNSIGNED NOT NULL, question_id INT UNSIGNED NOT NULL, choice_id INT UNSIGNED NOT NULL, rank INT NOT NULL, PRIMARY KEY (id), KEY response_question (response_id,question_id,choice_id))  
Success


(mysql): CREATE TABLE mdl_questionnaire_response_text ( `id` int(11) NOT NULL auto_increment, response_id INT UNSIGNED NOT NULL, question_id INT UNSIGNED NOT NULL, response TEXT, PRIMARY KEY (id), KEY response_question (response_id,question_id))  
Success


(mysql): CREATE TABLE mdl_questionnaire_response_other ( `id` int(11) NOT NULL auto_increment, response_id INT UNSIGNED NOT NULL, question_id INT UNSIGNED NOT NULL, choice_id INT UNSIGNED NOT NULL, response TEXT, PRIMARY KEY (id), KEY response_question (response_id,question_id,choice_id))  
Success


(mysql): CREATE TABLE mdl_questionnaire_response_date ( `id` int(11) NOT NULL auto_increment, response_id INT UNSIGNED NOT NULL, question_id INT UNSIGNED NOT NULL, response DATE, PRIMARY KEY (id), KEY response_question (response_id,question_id))  
Success


(mysql): INSERT INTO mdl_questionnaire_question_type VALUES ('1','Yes/No','N','response_bool')  
Success


(mysql): INSERT INTO mdl_questionnaire_question_type VALUES ('2','Text Box','N','response_text')  
Success


(mysql): INSERT INTO mdl_questionnaire_question_type VALUES ('3','Essay Box','N','response_text')  
Success


(mysql): INSERT INTO mdl_questionnaire_question_type VALUES ('4','Radio Buttons','Y','response_single')  
Success


(mysql): INSERT INTO mdl_questionnaire_question_type VALUES ('5','Check Boxes','Y','response_multiple')  
Success


(mysql): INSERT INTO mdl_questionnaire_question_type VALUES ('6','Dropdown Box','Y','response_single')  
Success


(mysql): INSERT INTO mdl_questionnaire_question_type VALUES ('8','Rate (scale 1..5)','Y','response_rank')  
Success


(mysql): INSERT INTO mdl_questionnaire_question_type VALUES ('9','Date','N','response_date')  
Success


(mysql): INSERT INTO mdl_questionnaire_question_type VALUES ('10','Numeric','N','response_text')  
Success


(mysql): INSERT INTO mdl_questionnaire_question_type VALUES ('99','Page Break','N','')  
Success


(mysql): INSERT INTO mdl_questionnaire_question_type VALUES ('100','Section Text','N','')  
Success

questionnaire tables have been set up correctly