public function exportQuestionAnswers(Question $question) { $handler = $this->handlerCollector->getHandlerForInteractionType($question->getType()); // question info $data = new \stdClass(); $data->id = $question->getId(); $data->feedback = $question->getFeedback() ? $question->getFeedback() : ''; $handler->convertQuestionAnswers($question, $data); return $data; }
/** * call method to export a question. * * @param \UJM\ExoBundle\Entity\Question $question */ public function export($question) { if ($question->getType() !== InteractionOpen::TYPE) { $service = 'ujm.exo_qti_export_' . $question->getType(); $qtiExport = $this->container->get($service); } else { $qtiExport = $this->serviceOpenQuestion($question->getId()); } return $qtiExport->export($question, $this); }