]> git.mjollnir.org Git - moodle.git/commitdiff
matching qtype: whitespace cleanup.
authortjhunt <tjhunt>
Thu, 11 Dec 2008 04:55:41 +0000 (04:55 +0000)
committertjhunt <tjhunt>
Thu, 11 Dec 2008 04:55:41 +0000 (04:55 +0000)
question/type/match/questiontype.php

index c03874adff40be6f47a76a3b69805ccf0b68599b..0bef45ef8a98d34316182b706b7892732f0a26ab 100644 (file)
@@ -132,8 +132,7 @@ class question_match_qtype extends default_questiontype {
             $answer->id       = $subquestion->code;
             $answer->answer   = $subquestion->answertext;
             $answer->fraction = 1.0;
-            $state->options->subquestions[$key]->options
-                    ->answers[$subquestion->code] = clone($answer);
+            $state->options->subquestions[$key]->options->answers[$subquestion->code] = clone($answer);
 
             $state->responses[$key] = '';
         }
@@ -155,14 +154,12 @@ class question_match_qtype extends default_questiontype {
                return false;
             }
         }
+
         // The serialized format for matching questions is a comma separated
         // list of question answer pairs (e.g. 1-1,2-3,3-2), where the ids of
         // both refer to the id in the table question_match_sub.
         $responses = explode(',', $state->responses['']);
-        $responses = array_map(create_function('$val',
-         'return explode("-", $val);'), $responses);
-
-
+        $responses = array_map(create_function('$val', 'return explode("-", $val);'), $responses);
 
         // Restore the previous responses and place the questions into the state options
         $state->responses = array();
@@ -181,8 +178,7 @@ class question_match_qtype extends default_questiontype {
             $answer->id       = $subquestion->code;
             $answer->answer   = format_string($subquestion->answertext);
             $answer->fraction = 1.0;
-            $state->options->subquestions[$key]->options
-             ->answers[$subquestion->code] = clone($answer);
+            $state->options->subquestions[$key]->options->answers[$subquestion->code] = clone($answer);
         }
 
         return true;