Moodle 3.9 error installing questionary plugin

Moodle 3.9 error installing questionary plugin

by jairo borjas -
Number of replies: 2

Anybody can please help? When installing the questionary plugin 3.9.1 (Build - 2020111801) (2020062302)  I get the following message:


×Debug info: Table 'mdlq1_questionnaire' already exists
CREATE TABLE mdlq1_questionnaire (
id BIGINT(10) NOT NULL auto_increment,
course BIGINT(10) NOT NULL DEFAULT 0,
name VARCHAR(255) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
intro LONGTEXT COLLATE utf8mb4_general_ci NOT NULL,
introformat SMALLINT(4) NOT NULL DEFAULT 0,
qtype BIGINT(10) NOT NULL DEFAULT 0,
respondenttype VARCHAR(9) COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'fullname',
resp_eligible VARCHAR(8) COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'all',
resp_view TINYINT(2) NOT NULL DEFAULT 0,
notifications TINYINT(1) NOT NULL DEFAULT 0,
opendate BIGINT(10) NOT NULL DEFAULT 0,
closedate BIGINT(10) NOT NULL DEFAULT 0,
resume TINYINT(2) NOT NULL DEFAULT 0,
navigate TINYINT(2) NOT NULL DEFAULT 0,
grade BIGINT(10) NOT NULL DEFAULT 0,
sid BIGINT(10) NOT NULL DEFAULT 0,
timemodified BIGINT(10) NOT NULL DEFAULT 0,
completionsubmit TINYINT(1) NOT NULL DEFAULT 0,
autonum TINYINT(1) NOT NULL DEFAULT 3,
progressbar TINYINT(1) NOT NULL DEFAULT 0,
CONSTRAINT PRIMARY KEY (id)
, KEY mdlq1_ques_res2_ix (resp_view)
, KEY mdlq1_ques_sid2_ix (sid)
, KEY mdlq1_ques_cou2_ix (course)
)
ENGINE = InnoDB
DEFAULT COLLATE = utf8mb4_general_ci ROW_FORMAT=Compressed
COMMENT='Main questionnaire table.'
;
CREATE TABLE mdlq1_questionnaire_survey (
id BIGINT(10) NOT NULL auto_increment,
name VARCHAR(255) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
courseid BIGINT(10),
realm VARCHAR(64) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
status BIGINT(10) NOT NULL DEFAULT 0,
title VARCHAR(255) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
email VARCHAR(255) COLLATE utf8mb4_general_ci,
subtitle LONGTEXT COLLATE utf8mb4_general_ci,
info LONGTEXT COLLATE utf8mb4_general_ci,
theme VARCHAR(64) COLLATE utf8mb4_general_ci,
thanks_page VARCHAR(255) COLLATE utf8mb4_general_ci,
thank_head VARCHAR(255) COLLATE utf8mb4_general_ci,
thank_body LONGTEXT COLLATE utf8mb4_general_ci,
feedbacksections TINYINT(2) DEFAULT 0,
feedbacknotes LONGTEXT COLLATE utf8mb4_general_ci,
feedbackscores TINYINT(1) DEFAULT 0,
chart_type VARCHAR(64) COLLATE utf8mb4_general_ci,
CONSTRAINT PRIMARY KEY (id)
, KEY mdlq1_quessurv_nam2_ix (name)
, KEY mdlq1_quessurv_cou2_ix (courseid)
)
ENGINE = InnoDB
DEFAULT COLLATE = utf8mb4_general_ci ROW_FORMAT=Compressed
COMMENT='questionnaire_survey table retrofitted from MySQL'
;
CREATE TABLE mdlq1_questionnaire_question (
id BIGINT(10) NOT NULL auto_increment,
surveyid BIGINT(10) NOT NULL DEFAULT 0,
name VARCHAR(30) COLLATE utf8mb4_general_ci,
type_id BIGINT(10) NOT NULL DEFAULT 0,
result_id BIGINT(10),
length BIGINT(10) NOT NULL DEFAULT 0,
precise BIGINT(10) NOT NULL DEFAULT 0,
position BIGINT(10) NOT NULL DEFAULT 0,
content LONGTEXT COLLATE utf8mb4_general_ci NOT NULL,
required VARCHAR(1) COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'n',
deleted VARCHAR(1) COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'n',
extradata LONGTEXT COLLATE utf8mb4_general_ci,
CONSTRAINT PRIMARY KEY (id)
, KEY mdlq1_quesques_surdel2_ix (surveyid, deleted)
)
ENGINE = InnoDB
DEFAULT COLLATE = utf8mb4_general_ci ROW_FORMAT=Compressed
COMMENT='questionnaire_question table retrofitted from MySQL'
;
CREATE TABLE mdlq1_questionnaire_quest_choice (
id BIGINT(10) NOT NULL auto_increment,
question_id BIGINT(10) NOT NULL DEFAULT 0,
content LONGTEXT COLLATE utf8mb4_general_ci NOT NULL,
value LONGTEXT COLLATE utf8mb4_general_ci,
CONSTRAINT PRIMARY KEY (id)
, KEY mdlq1_quesqueschoi_que2_ix (question_id)
)
ENGINE = InnoDB
DEFAULT COLLATE = utf8mb4_general_ci ROW_FORMAT=Compressed
COMMENT='questionnaire_quest_choice table retrofitted from MySQL'
;
CREATE TABLE mdlq1_questionnaire_question_type (
id BIGINT(10) NOT NULL auto_increment,
typeid BIGINT(10) NOT NULL DEFAULT 0,
type VARCHAR(32) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
has_choices VARCHAR(1) COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'y',
response_table VARCHAR(32) COLLATE utf8mb4_general_ci,
CONSTRAINT PRIMARY KEY (id)
, UNIQUE KEY mdlq1_quesquestype_typ2_uix (typeid)
)
ENGINE = InnoDB
DEFAULT COLLATE = utf8mb4_general_ci ROW_FORMAT=Compressed
COMMENT='questionnaire_question_type table retrofitted from MySQL'
;
CREATE TABLE mdlq1_questionnaire_response (
id BIGINT(10) NOT NULL auto_increment,
questionnaireid BIGINT(10) NOT NULL DEFAULT 0,
submitted BIGINT(10) NOT NULL DEFAULT 0,
complete VARCHAR(1) COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'n',
grade BIGINT(10) NOT NULL DEFAULT 0,
userid BIGINT(10),
CONSTRAINT PRIMARY KEY (id)
, KEY mdlq1_quesresp_que2_ix (questionnaireid)
)
ENGINE = InnoDB
DEFAULT COLLATE = utf8mb4_general_ci ROW_FORMAT=Compressed
COMMENT='questionnaire_response table retrofitted from MySQL'
;
CREATE TABLE mdlq1_questionnaire_response_bool (
id BIGINT(10) NOT NULL auto_increment,
response_id BIGINT(10) NOT NULL DEFAULT 0,
question_id BIGINT(10) NOT NULL DEFAULT 0,
choice_id VARCHAR(1) COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'y',
CONSTRAINT PRIMARY KEY (id)
, KEY mdlq1_quesrespbool_resque2_ix (response_id, question_id)
)
ENGINE = InnoDB
DEFAULT COLLATE = utf8mb4_general_ci ROW_FORMAT=Compressed
COMMENT='questionnaire_response_bool table retrofitted from MySQL'
;
CREATE TABLE mdlq1_questionnaire_response_date (
id BIGINT(10) NOT NULL auto_increment,
response_id BIGINT(10) NOT NULL DEFAULT 0,
question_id BIGINT(10) NOT NULL DEFAULT 0,
response LONGTEXT COLLATE utf8mb4_general_ci,
CONSTRAINT PRIMARY KEY (id)
, KEY mdlq1_quesrespdate_resque2_ix (response_id, question_id)
)
ENGINE = InnoDB
DEFAULT COLLATE = utf8mb4_general_ci ROW_FORMAT=Compressed
COMMENT='questionnaire_response_date table retrofitted from MySQL'
;
CREATE TABLE mdlq1_questionnaire_resp_multiple (
id BIGINT(10) NOT NULL auto_increment,
response_id BIGINT(10) NOT NULL DEFAULT 0,
question_id BIGINT(10) NOT NULL DEFAULT 0,
choice_id BIGINT(10) NOT NULL DEFAULT 0,
CONSTRAINT PRIMARY KEY (id)
, KEY mdlq1_quesrespmult_resquec2_ix (response_id, question_id, choice_id)
)
ENGINE = InnoDB
DEFAULT COLLATE = utf8mb4_general_ci ROW_FORMAT=Compressed
COMMENT='questionnaire_resp_multiple table retrofitted from MySQL'
;
CREATE TABLE mdlq1_questionnaire_response_other (
id BIGINT(10) NOT NULL auto_increment,
response_id BIGINT(10) NOT NULL DEFAULT 0,
question_id BIGINT(10) NOT NULL DEFAULT 0,
choice_id BIGINT(10) NOT NULL DEFAULT 0,
response LONGTEXT COLLATE utf8mb4_general_ci,
CONSTRAINT PRIMARY KEY (id)
, KEY mdlq1_quesrespothe_resquec2_ix (response_id, question_id, choice_id)
)
ENGINE = InnoDB
DEFAULT COLLATE = utf8mb4_general_ci ROW_FORMAT=Compressed
COMMENT='questionnaire_response_other table retrofitted from MySQL'
;
CREATE TABLE mdlq1_questionnaire_response_rank (
id BIGINT(10) NOT NULL auto_increment,
response_id BIGINT(10) NOT NULL DEFAULT 0,
question_id BIGINT(10) NOT NULL DEFAULT 0,
choice_id BIGINT(10) NOT NULL DEFAULT 0,
rankvalue BIGINT(11) NOT NULL DEFAULT 0,
CONSTRAINT PRIMARY KEY (id)
, KEY mdlq1_quesresprank_resquec2_ix (response_id, question_id, choice_id)
)
ENGINE = InnoDB
DEFAULT COLLATE = utf8mb4_general_ci ROW_FORMAT=Compressed
COMMENT='questionnaire_response_rank table retrofitted from MySQL'
;
CREATE TABLE mdlq1_questionnaire_resp_single (
id BIGINT(10) NOT NULL auto_increment,
response_id BIGINT(10) NOT NULL DEFAULT 0,
question_id BIGINT(10) NOT NULL DEFAULT 0,
choice_id BIGINT(10) NOT NULL DEFAULT 0,
CONSTRAINT PRIMARY KEY (id)
, KEY mdlq1_quesrespsing_resque2_ix (response_id, question_id)
)
ENGINE = InnoDB
DEFAULT COLLATE = utf8mb4_general_ci ROW_FORMAT=Compressed
COMMENT='questionnaire_resp_single table retrofitted from MySQL'
;
CREATE TABLE mdlq1_questionnaire_response_text (
id BIGINT(10) NOT NULL auto_increment,
response_id BIGINT(10) NOT NULL DEFAULT 0,
question_id BIGINT(10) NOT NULL DEFAULT 0,
response LONGTEXT COLLATE utf8mb4_general_ci,
CONSTRAINT PRIMARY KEY (id)
, KEY mdlq1_quesresptext_resque2_ix (response_id, question_id)
)
ENGINE = InnoDB
DEFAULT COLLATE = utf8mb4_general_ci ROW_FORMAT=Compressed
COMMENT='questionnaire_response_text table retrofitted from MySQL'
;
CREATE TABLE mdlq1_questionnaire_fb_sections (
id BIGINT(10) NOT NULL auto_increment,
surveyid BIGINT(10) NOT NULL DEFAULT 0,
section TINYINT(2),
scorecalculation LONGTEXT COLLATE utf8mb4_general_ci,
sectionlabel VARCHAR(50) COLLATE utf8mb4_general_ci,
sectionheading LONGTEXT COLLATE utf8mb4_general_ci,
sectionheadingformat TINYINT(2) DEFAULT 1,
CONSTRAINT PRIMARY KEY (id)
, KEY mdlq1_quesfbsect_sur2_ix (surveyid)
)
ENGINE = InnoDB
DEFAULT COLLATE = utf8mb4_general_ci ROW_FORMAT=Compressed
COMMENT='questionnaire_fb_sections table retrofitted from MySQL'
;
CREATE TABLE mdlq1_questionnaire_feedback (
id BIGINT(10) NOT NULL auto_increment,
sectionid BIGINT(10) NOT NULL DEFAULT 0,
feedbacklabel VARCHAR(50) COLLATE utf8mb4_general_ci,
feedbacktext LONGTEXT COLLATE utf8mb4_general_ci,
feedbacktextformat TINYINT(2) DEFAULT 1,
minscore NUMERIC(10,5) DEFAULT 0.00000,
maxscore NUMERIC(10,5) DEFAULT 101.00000,
CONSTRAINT PRIMARY KEY (id)
, KEY mdlq1_quesfeed_sec2_ix (sectionid)
)
ENGINE = InnoDB
DEFAULT COLLATE = utf8mb4_general_ci ROW_FORMAT=Compressed
COMMENT='questionnaire_feedback table retrofitted from MySQL'
;
CREATE TABLE mdlq1_questionnaire_dependency (
id BIGINT(10) NOT NULL auto_increment,
questionid BIGINT(10) NOT NULL DEFAULT 0,
surveyid BIGINT(10) NOT NULL,
dependquestionid BIGINT(10) NOT NULL DEFAULT 0,
dependchoiceid BIGINT(10) NOT NULL DEFAULT 0,
dependlogic TINYINT(2) NOT NULL DEFAULT 0,
dependandor VARCHAR(4) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
CONSTRAINT PRIMARY KEY (id)
, KEY mdlq1_quesdepe_que2_ix (questionid)
, KEY mdlq1_quesdepe_sur2_ix (surveyid)
)
ENGINE = InnoDB
DEFAULT COLLATE = utf8mb4_general_ci ROW_FORMAT=Compressed
COMMENT='Holds the combined dependencies per question to navigate in '
Error code: ddlexecuteerror
×Stack trace:
  • line 492 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown
  • line 1098 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 77 of /lib/ddl/database_manager.php: call to mysqli_native_moodle_database->change_database_structure()
  • line 427 of /lib/ddl/database_manager.php: call to database_manager->execute_sql_arr()
  • line 372 of /lib/ddl/database_manager.php: call to database_manager->install_from_xmldb_structure()
  • line 830 of /lib/upgradelib.php: call to database_manager->install_from_xmldb_file()
  • line 565 of /lib/upgradelib.php: call to upgrade_plugins_modules()
  • line 1917 of /lib/upgradelib.php: call to upgrade_plugins()
  • line 713 of /admin/index.php: call to upgrade_noncore()

Average of ratings: -
In reply to jairo borjas

Re: Moodle 3.9 error installing questionary plugin

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Jairo,
I cannot help you with this problem. Maybe someone else will. But I would like to point out that it is not a good idea to put such long error messages in the text of one's post. Much better to attach a text file to your post.
In reply to jairo borjas

Re: Moodle 3.9 error installing questionary plugin

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
The error indicates that the questionnaire tables already exist in your database. If you are installing, that means Moodle doesn't know that it was already installed. if you are sure that there is no data in the questionnaire tables that you want to keep, remove (or rename them) from your database before trying to install the questionnaire.