From 65cf651fd8ecbc7dd1f803a8ca2eb8d94f71e065 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Tue, 25 Sep 2012 14:08:59 +0100 Subject: [PATCH] MDL-35620 question engine: should distinguish NULL and 0. This only matters in an obscure edge case, but it is an edge case we hit with one of the OU question types. This load data code is processing the results of a LEFT JOIN, so is_null is the correct logic. --- question/engine/questionattemptstep.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/question/engine/questionattemptstep.php b/question/engine/questionattemptstep.php index 4cd813a1132..20a34da5c81 100644 --- a/question/engine/questionattemptstep.php +++ b/question/engine/questionattemptstep.php @@ -386,7 +386,7 @@ class question_attempt_step { $record = $currentrec; $data = array(); while ($currentrec && $currentrec->attemptstepid == $attemptstepid) { - if ($currentrec->name) { + if (!is_null($currentrec->name)) { $data[$currentrec->name] = $currentrec->value; } $records->next();