Bug #6185 - bug with matching questions.
authortjhunt <tjhunt>
Fri, 28 Jul 2006 10:56:47 +0000 (10:56 +0000)
committertjhunt <tjhunt>
Fri, 28 Jul 2006 10:56:47 +0000 (10:56 +0000)
question/type/match/questiontype.php

index 96cf900..e8a7f56 100644 (file)
@@ -190,6 +190,7 @@ class question_match_qtype extends default_questiontype {
         // Serialize responses
         $responses = array();
         foreach ($subquestions as $key => $subquestion) {
+            $response = 0;
             if ($subquestion->questiontext) {
                 if ($state->responses[$key]) {
                     $response = $state->responses[$key];
@@ -203,11 +204,9 @@ class question_match_qtype extends default_questiontype {
                             $state->responses[$key] = $response;
                         }
                     }
-                } else {
-                    $response = 0;
                 }
-                $responses[] = $key.'-'.$response;
             }
+            $responses[] = $key.'-'.$response;
         }
         $responses = implode(',', $responses);