diff --git a/question.php b/question.php index 3e4e38b..8ba5e95 100644 --- a/question.php +++ b/question.php @@ -133,6 +133,14 @@ private function set_shortanswer_matching_answers(array $response) { $qimpl->setAssertion("equivalent_symbolic", 0, 0); } + // Since we are generating all the slots artificially by cloning the first one, + // set its answer field type as the default for the question. + $slots = $qimpl->slots; + if ($slots != null && isset($slots[0])) { + $answerFieldType = $slots[0]->getAnswerFieldType(); + $qimpl->setAnswerFieldType($answerFieldType); + } + // Remove all non-syntactic assertions from question and save to $assertions array. for ($i = $qimpl->assertions->length - 1; $i >= 0; $i--) { $assertion = $qimpl->assertions[$i];