Bug 5971 - Allow matching questions to have extra wrong answers - supplimental. I missed a bit last time.

This commit is contained in:
tjhunt
2006-07-05 11:58:14 +00:00
parent eaaf06f1ce
commit 0c24ee0fbf
+4 -3
View File
@@ -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;