/** * Create hole * * @access protected * * @param Intger $size hole's size for the input * @param String $qtiId id of hole in the qti file * @param boolean $selector text or list * @param Integer $position position of hole in the text * */ protected function createHole($size, $qtiId, $selector, $position) { $hole = new Hole(); $hole->setSize($size); $hole->setSelector($selector); $hole->setPosition($position); $hole->setInteractionHole($this->interactionHole); $this->om->persist($hole); $this->createWordResponse($qtiId, $hole); }
/** * {@inheritdoc} */ public function persistInteractionDetails(Question $question, \stdClass $importData) { $interaction = new InteractionHole(); for ($i = 0, $max = count($importData->holes); $i < $max; ++$i) { // temporary limitation if ($importData->holes[$i]->type !== 'text/html') { throw new \Exception("Import not implemented for MIME type {$importData->holes[$i]->type}"); } $hole = new Hole(); $hole->setOrdre($i); $hole->setInteractionHole($interaction); $interaction->addHole($hole); $this->om->persist($hole); } $interaction->setQuestion($question); $this->om->persist($interaction); }
public function addHole(\UJM\ExoBundle\Entity\Hole $hole) { $this->holes[] = $hole; $hole->setInteractionHole($this); }