From 28a8ec91489ee0d01ffda2376356142ac4572bc7 Mon Sep 17 00:00:00 2001 From: gustav_delius Date: Sun, 30 Apr 2006 16:23:55 +0000 Subject: [PATCH] Make sure that the newgraded field always points to a valid state. --- mod/quiz/db/mysql.php | 5 +++++ mod/quiz/db/postgres7.php | 5 +++++ 2 files changed, 10 insertions(+) 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; } -- 2.39.5