This commit is contained in:
Huong Nguyen
2024-01-17 16:24:28 +07:00
+8 -4
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');