From 0c24ee0fbfd29e2d7ba3d98100a4cc7fd5f11818 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Wed, 5 Jul 2006 11:58:14 +0000 Subject: [PATCH] Bug 5971 - Allow matching questions to have extra wrong answers - supplimental. I missed a bit last time. --- question/type/match/questiontype.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/question/type/match/questiontype.php b/question/type/match/questiontype.php index c17ca9c0e9..a621bed1c0 100644 --- a/question/type/match/questiontype.php +++ b/question/type/match/questiontype.php @@ -181,13 +181,14 @@ class question_match_qtype extends default_questiontype { // Serialize responses $responses = array(); foreach ($state->options->subquestions as $key => $subquestion) { - $responses[] = $key.'-'.($state->responses[$key] ? $state->responses[$key] : 0); + if ($subquestion->questiontext) { + $responses[] = $key.'-'.($state->responses[$key] ? $state->responses[$key] : 0); + } } $responses = implode(',', $responses); // Set the legacy answer field - if (!set_field('question_states', 'answer', $responses, 'id', - $state->id)) { + if (!set_field('question_states', 'answer', $responses, 'id', $state->id)) { return false; } return true; -- 2.39.5