MDL-67335 qtype_calculatedmulti: Fix upgrade query.

This commit is contained in:
Ilya Tregubov 2024-01-17 17:11:59 +08:00
parent 79494ac32d
commit 1fdd34a08f

View File

@ -38,10 +38,14 @@ function xmldb_qtype_calculatedmulti_upgrade($oldversion) {
// From this version on, answer options may use HTML, so the answerformat does now have a
// meaning. For backwards compatibility, all existing answer options for this question
// type must have their answerformat set to FORMAT_PLAIN.
$DB->execute("UPDATE {question_answers} AS answers, {question} AS questions
SET answerformat = '" . FORMAT_PLAIN . "'
WHERE answers.question = questions.id
AND questions.qtype = 'calculatedmulti'");
$DB->execute("UPDATE {question_answers}
SET answerformat = '" . FORMAT_PLAIN . "'
WHERE question IN (
SELECT id
FROM {question}
WHERE qtype = 'calculatedmulti'
)"
);
// Calculatedmulti savepoint reached.
upgrade_plugin_savepoint(true, 2024011700, 'qtype', 'calculatedmulti');