ndunand / moodle-qtype_matrix

Source code of https://moodle.org/plugins/qtype_matrix
2 stars 10 forks source link

Error from Matrix question - cannot see question, cannot edit it. Moodle 3.3 #42

Open ghost opened 5 years ago

ghost commented 5 years ago

Hi There, I get an error from the Matrix question type. Using version 2018050701 of the plugin.

Either entering the quiz (Matrix question is question 1) or editing the Matrix question give the error:

Error reading from database

More information about this error Debug info: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'rows INNER JOIN mdl_question_matrix ' at line 4 SELECT weights.* FROM mdl_question_matrix_weights AS weights WHERE rowid IN (SELECT rows.id FROM mdl_question_matrix_rows AS rows INNER JOIN mdl_question_matrix AS matrix ON rows.matrixid = matrix.id WHERE matrix.questionid = 17) OR

colid IN (SELECT cols.id FROM mdl_question_matrix_cols AS cols INNER JOIN mdl_question_matrix AS matrix ON cols.matrixid = matrix.id WHERE matrix.questionid = 17)

[array ( )] Error code: dmlreadexception Stack trace:

line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 1190 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
line 286 of /question/type/matrix/libs/question_matrix_store.php: call to mysqli_native_moodle_database->get_records_sql()
line 145 of /question/type/matrix/questiontype.php: call to question_matrix_store->get_matrix_weights_by_question_id()
line 106 of /question/type/matrix/questiontype.php: call to qtype_matrix::retrieve_matrix()
line 783 of /lib/questionlib.php: call to qtype_matrix->get_question_options()
line 816 of /lib/questionlib.php: call to _tidy_question()
line 123 of /question/question.php: call to get_question_options()

Cheers

Dave Emsley

ndunand commented 5 years ago

Hi Dave,

rows is a reserved keyword in MariaDB, this has been fixed in #41 but not released yet.

Can you manually update your plugin with the master branch here and confirm it solves the issue?

ghost commented 5 years ago

Perfect. Many thanks for resolving this for us.

Dave