From: gustav_delius Date: Sun, 30 Apr 2006 16:23:55 +0000 (+0000) Subject: Make sure that the newgraded field always points to a valid state. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=28a8ec91489ee0d01ffda2376356142ac4572bc7;p=moodle.git Make sure that the newgraded field always points to a valid state. --- diff --git a/mod/quiz/db/mysql.php b/mod/quiz/db/mysql.php index ac46c56e08..721771a9a7 100644 --- a/mod/quiz/db/mysql.php +++ b/mod/quiz/db/mysql.php @@ -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; } diff --git a/mod/quiz/db/postgres7.php b/mod/quiz/db/postgres7.php index 4290ed57aa..2b217c8f1e 100644 --- a/mod/quiz/db/postgres7.php +++ b/mod/quiz/db/postgres7.php @@ -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; }