mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-8127 - bad use of DESCRIPTION constant in quiz module causes upgrade to fail. Thanks to Pavel Krejci for the fix. Merged from MOODLE_17_STABLE.
This commit is contained in:
parent
277e551b88
commit
d2ab495693
@ -551,7 +551,7 @@ function quiz_upgrade($oldversion) {
|
||||
// length of question determines question numbering. Currently all questions require one
|
||||
// question number except for DESCRIPTION questions.
|
||||
$success = $success && table_column('quiz_questions', '', 'length', 'integer', '10', 'unsigned', '1', 'not null', 'qtype');
|
||||
$success = $success && execute_sql("UPDATE {$CFG->prefix}quiz_questions SET length = 0 WHERE qtype = ".DESCRIPTION);
|
||||
$success = $success && execute_sql("UPDATE {$CFG->prefix}quiz_questions SET length = 0 WHERE qtype ='7'");
|
||||
}
|
||||
|
||||
if ($success && $oldversion < 2005050408) {
|
||||
@ -892,7 +892,7 @@ function quiz_upgrade($oldversion) {
|
||||
if ($success && $oldversion < 2006021101) {
|
||||
// set defaultgrade field properly (probably not necessary, but better make sure)
|
||||
$success = $success && execute_sql("UPDATE {$CFG->prefix}quiz_questions SET defaultgrade = '1' WHERE defaultgrade = '0'", false);
|
||||
$success = $success && execute_sql("UPDATE {$CFG->prefix}quiz_questions SET defaultgrade = '0' WHERE qtype = '".DESCRIPTION."'", false);
|
||||
$success = $success && execute_sql("UPDATE {$CFG->prefix}quiz_questions SET defaultgrade = '0' WHERE qtype = '7'", false);
|
||||
}
|
||||
|
||||
if ($success && $oldversion < 2006021103) {
|
||||
|
@ -653,7 +653,7 @@ function quiz_upgrade($oldversion) {
|
||||
// length of question determines question numbering. Currently all questions require one
|
||||
// question number except for DESCRIPTION questions.
|
||||
$success = $success && table_column('quiz_questions', '', 'length', 'integer', '10', 'unsigned', '1', 'not null', 'qtype');
|
||||
$success = $success && execute_sql("UPDATE {$CFG->prefix}quiz_questions SET length = 0 WHERE qtype = ".DESCRIPTION);
|
||||
$success = $success && execute_sql("UPDATE {$CFG->prefix}quiz_questions SET length = 0 WHERE qtype = '7'");
|
||||
}
|
||||
|
||||
if ($success && $oldversion < 2005050408) {
|
||||
@ -994,7 +994,7 @@ function quiz_upgrade($oldversion) {
|
||||
if ($success && $oldversion < 2006021101) {
|
||||
// set defaultgrade field properly (probably not necessary, but better make sure)
|
||||
$success && execute_sql("UPDATE {$CFG->prefix}quiz_questions SET defaultgrade = '1' WHERE defaultgrade = '0'", false);
|
||||
$success && execute_sql("UPDATE {$CFG->prefix}quiz_questions SET defaultgrade = '0' WHERE qtype = '".DESCRIPTION."'", false);
|
||||
$success && execute_sql("UPDATE {$CFG->prefix}quiz_questions SET defaultgrade = '0' WHERE qtype = '7'", false);
|
||||
}
|
||||
|
||||
if ($success && $oldversion < 2006021103) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user