コード例 #1
0
 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;
 }
コード例 #2
0
 /**
  * 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);
 }