Permalink
Browse files

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.
  • Loading branch information...
1 parent 9273bd1 commit f0f201431682d94e83fe4c5baf35e847e1fb9f30 @timhunt timhunt committed Sep 25, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 question/engine/questionattemptstep.php
@@ -386,7 +386,7 @@ public static function load_from_records($records, $attemptstepid) {
$record = $currentrec;
$data = array();
while ($currentrec && $currentrec->attemptstepid == $attemptstepid) {
- if ($currentrec->name) {
+ if (!is_null($currentrec->name)) {
$data[$currentrec->name] = $currentrec->value;
}
$records->next();

0 comments on commit f0f2014

Please sign in to comment.