From f8394114c35b851fda038d83c421eb293444c38d Mon Sep 17 00:00:00 2001 From: tjhunt Date: Thu, 11 Dec 2008 04:55:41 +0000 Subject: [PATCH] matching qtype: whitespace cleanup. --- question/type/match/questiontype.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/question/type/match/questiontype.php b/question/type/match/questiontype.php index c03874adff..0bef45ef8a 100644 --- a/question/type/match/questiontype.php +++ b/question/type/match/questiontype.php @@ -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; -- 2.39.5