]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-8127 - bad use of DESCRIPTION constant in quiz module causes upgrade to fail...
authortjhunt <tjhunt>
Wed, 14 Mar 2007 21:24:44 +0000 (21:24 +0000)
committertjhunt <tjhunt>
Wed, 14 Mar 2007 21:24:44 +0000 (21:24 +0000)
mod/quiz/db/mysql.php
mod/quiz/db/postgres7.php

index d29eaa6bd7ca948138f20d78fd988b0ccce5aa3a..53bcf73273a006704c7254a6f3d754be6e356b56 100644 (file)
@@ -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) {
index fb999d4bd464ef4ce014a65773d2468a15414eda..d7b460e7bf1f95d9525d84b050fc7a5694d42865 100644 (file)
@@ -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) {