Upgrade 2.7.19 > 3.1.5+ : qtype_ddimageortext " ddlexecuteerror

Upgrade 2.7.19 > 3.1.5+ : qtype_ddimageortext " ddlexecuteerror

by Visvanath Ratnaweera -
Number of replies: 4
Picture of Particularly helpful Moodlers Picture of Translators
I am upgrading a 2.7.19 (Build: 20170313) site to 3.1.5+ (Build: 20170331).

The process halts with:
===
qtype_ddimageortext
DDL sql execution error

More information about this error

Debug info: Table 'mdl_qtype_ddimageortext' already exists
CREATE TABLE mdl_qtype_ddimageortext (
id BIGINT(10) NOT NULL auto_increment,
questionid BIGINT(10) NOT NULL DEFAULT 0,
shuffleanswers SMALLINT(4) NOT NULL DEFAULT 1,
correctfeedback LONGTEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
correctfeedbackformat TINYINT(2) NOT NULL DEFAULT 0,
partiallycorrectfeedback LONGTEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
partiallycorrectfeedbackformat TINYINT(2) NOT NULL DEFAULT 0,
incorrectfeedback LONGTEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
incorrectfeedbackformat TINYINT(2) NOT NULL DEFAULT 0,
shownumcorrect TINYINT(2) NOT NULL DEFAULT 0,
CONSTRAINT PRIMARY KEY (id)
, KEY mdl_qtypddim_que2_ix (questionid)
)
ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE = utf8_unicode_ci
COMMENT='Defines drag and drop (text or images onto a background imag'
;
CREATE TABLE mdl_qtype_ddimageortext_drops (
id BIGINT(10) NOT NULL auto_increment,
questionid BIGINT(10) NOT NULL DEFAULT 0,
no BIGINT(10) NOT NULL DEFAULT 0,
xleft BIGINT(10) NOT NULL DEFAULT 0,
ytop BIGINT(10) NOT NULL DEFAULT 0,
choice BIGINT(10) NOT NULL DEFAULT 0,
label LONGTEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
CONSTRAINT PRIMARY KEY (id)
, KEY mdl_qtypddimdrop_que2_ix (questionid)
)
ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE = utf8_unicode_ci
COMMENT='Drop boxes'
;
CREATE TABLE mdl_qtype_ddimageortext_drags (
id BIGINT(10) NOT NULL auto_increment,
questionid BIGINT(10) NOT NULL DEFAULT 0,
no BIGINT(10) NOT NULL DEFAULT 0,
draggroup BIGINT(10) NOT NULL DEFAULT 0,
infinite SMALLINT(4) NOT NULL DEFAULT 0,
label LONGTEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
CONSTRAINT PRIMARY KEY (id)
, KEY mdl_qtypddimdrag_que2_ix (questionid)
)
ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE = utf8_unicode_ci
COMMENT='Images to drag. Actual file names are not stored here we use'
Error code: ddlexecuteerror
Stack trace:
line 485 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown
line 1000 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 425 of /lib/ddl/database_manager.php: call to database_manager->execute_sql_arr()
line 370 of /lib/ddl/database_manager.php: call to database_manager->install_from_xmldb_structure()
line 514 of /lib/upgradelib.php: call to database_manager->install_from_xmldb_file()
line 1742 of /lib/upgradelib.php: call to upgrade_plugins()
line 683 of /admin/index.php: call to upgrade_noncore()
===
The more information link points to https://docs.moodle.org/31/en/error/moodle/ddlexecuteerror

I have upgraded a copy of the same site, in the same server, a couple of weeks ago. It was before the recent security update. The Moodle version then was 2.7.17+ (Build: 20161129).

Has the update 2.7.17 > 2.7.19 introduced a bug?
Average of ratings: -
In reply to Visvanath Ratnaweera

Re: Upgrade 2.7.19 > 3.1.5+ : qtype_ddimageortext " ddlexecuteerror

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
To be added the following four question type checks on the upgrade screen:

Drag-and-drop auf Bild /question/type/ddimageortext
2016052300 Moodle 2016051900
qtype_gapselect (2016051900) Standard Wird installiert

Drag-and-drop-Markierungen /question/type/ddmarker
2016052300 Moodle 2016051900
qtype_gapselect (2016051900)

qtype_ddimageortext (2016051900)
Standard Wird installiert

Drag-and-drop auf Text /question/type/ddwtos
2016052300 Moodle 2016051900
qtype_gapselect (2016051900)
Standard Wird installiert
In reply to Visvanath Ratnaweera

Re: Upgrade 2.7.19 > 3.1.5+ : qtype_ddimageortext " ddlexecuteerror

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

I had this issue too.  The way I fixed it was to go into the database, rename all those tables (from the four new question types) to tablename.old, run the upgrade and then, if you are missing data, check that the table layout is the same and then rename back the old tables.

Average of ratings: Useful (1)
In reply to Emma Richardson

Re: Upgrade 2.7.19 > 3.1.5+ : qtype_ddimageortext " ddlexecuteerror

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Emma

That is a radical approach!
wink

I noticed that all those tables have no data anyway. Therefore started dropping them "interactively". After dropping these tables the upgrade script moved forward (prefix removed):
- qtype_ddimageortext
- qtype_ddimageortext_drags
- qtype_ddimageortext_drops
- qtype_ddmarker
- qtype_ddmarker_drags
- qtype_ddmarker_drops
- question_gapselect,
- question_ddwtos

Looks like that obstacle is over. Many thanks!

Now I am the next one, here: https://moodle.org/mod/forum/discuss.php?d=350380, in the Assignment forum.
;-(