/** * Sets answer for current question. * @param $answer */ public function setAnswer($answer) { $matches = array(); $answer = Utils::cleanStyles($answer); preg_match_all('/{\\d+\\:SHORTANSWER\\:\\%\\d+\\%(.*?)\\#\\}+?/', $answer, $matches); if (empty($matches)) { throw new \UnexpectedValueException("No se ha obtenido ningun valor esperado de respuesta"); } array_shift($matches); $this->answer = reset($matches[0]); }
/** * @inheritdoc */ public function setQuestionText($text) { $this->question_text = Utils::cleanStyles($text); }
/** * Sets text for answer. * * @param string $texto */ public function setRespuesta($texto) { $this->respuesta = Utils::cleanStyles($texto); }