$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] = '';
}
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();
$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;