]> git.mjollnir.org Git - moodle.git/commitdiff
Make sure that the newgraded field always points to a valid state.
authorgustav_delius <gustav_delius>
Sun, 30 Apr 2006 16:23:55 +0000 (16:23 +0000)
committergustav_delius <gustav_delius>
Sun, 30 Apr 2006 16:23:55 +0000 (16:23 +0000)
mod/quiz/db/mysql.php
mod/quiz/db/postgres7.php

index ac46c56e0807793d83db52e8096c14315e4ce751..721771a9a712e007049af4355b8d1c0b9858899e 100644 (file)
@@ -1035,6 +1035,11 @@ function quiz_upgrade($oldversion) {
         }
     }
 
+    if ($oldversion < 2006043000) {
+        // The newgraded field must always point to a valid state
+        modify_database("","UPDATE prefix_question_sessions SET newgraded = newest where newgraded = '0'");
+    }
+
     return true;
 }
 
index 4290ed57aab01f90578ac85a906e898217a232ad..2b217c8f1ebf431c82438b8ca3e4e7f5f62c537d 100644 (file)
@@ -1206,6 +1206,11 @@ function quiz_upgrade($oldversion) {
         }
     }
 
+    if ($oldversion < 2006043000) {
+        // The newgraded field must always point to a valid state
+        modify_database("","UPDATE prefix_question_sessions SET newgraded = newest where newgraded = '0'");
+    }
+
     return true;
 }