Esempio n. 1
0
 /**
  * Implements the abstract method
  *
  * @access public
  * @param \UJM\ExoBundle\Entity\Interaction $interaction
  * @param qtiRepository $qtiRepos
  *
  */
 public function export(\UJM\ExoBundle\Entity\Interaction $interaction, qtiRepository $qtiRepos)
 {
     $this->qtiRepos = $qtiRepos;
     $this->question = $interaction->getQuestion();
     $this->interactiongraph = $this->doctrine->getManager()->getRepository('UJMExoBundle:InteractionGraphic')->findOneBy(array('interaction' => $interaction->getId()));
     if (count($this->interactiongraph->getCoords()) > 1) {
         $cardinality = 'multiple';
     } else {
         $cardinality = 'single';
     }
     $this->qtiHead('selectPoint', $this->question->getTitle());
     $this->qtiResponseDeclaration('RESPONSE', 'point', $cardinality);
     $this->qtiOutComeDeclaration();
     $this->correctResponseTag();
     $this->areaMappingTag();
     $this->itemBodyTag();
     $this->selectPointInteractionTag();
     $this->promptTag();
     if ($this->interactiongraph->getInteraction()->getFeedBack() != Null && $this->interactiongraph->getInteraction()->getFeedBack() != "") {
         $this->qtiFeedBack($interaction->getFeedBack());
     }
     $this->document->save($this->qtiRepos->getUserDir() . $this->question->getId() . '_qestion_qti.xml');
     $this->getPicture();
     return $this->getResponse();
 }
Esempio n. 2
0
 /**
  * Implements the abstract method
  *
  * @access public
  * @param \UJM\ExoBundle\Entity\Interaction $interaction
  * @param qtiRepository $qtiRepos
  *
  */
 public function export(\UJM\ExoBundle\Entity\Interaction $interaction, qtiRepository $qtiRepos)
 {
     $this->qtiRepos = $qtiRepos;
     $this->question = $interaction->getQuestion();
     $this->interactionqcm = $this->doctrine->getManager()->getRepository('UJMExoBundle:InteractionQCM')->findOneBy(array('interaction' => $interaction->getId()));
     //if it's Null mean "Global notation for QCM" Else it's Notation for each choice
     $weightresponse = $this->interactionqcm->getWeightResponse();
     if ($this->interactionqcm->getTypeQCM() == 'Multiple response') {
         $choiceType = 'choiceMultiple';
         $cardinality = 'multiple';
     } else {
         $choiceType = 'choice';
         $cardinality = 'single';
     }
     $this->qtiHead($choiceType, $this->question->getTitle());
     $this->qtiResponseDeclaration('RESPONSE', 'identifier', $cardinality);
     $this->qtiOutComeDeclaration();
     $this->correctResponseTag();
     $this->itemBodyTag();
     $this->choiceInteractionTag();
     $this->promptTag();
     //comment globale for this question
     if ($this->interactionqcm->getInteraction()->getFeedBack() != Null && $this->interactionqcm->getInteraction()->getFeedBack() != "") {
         $this->qtiFeedBack($interaction->getFeedBack());
     }
     if ($weightresponse == false) {
         $this->node->appendChild($this->responseProcessing);
     }
     $this->document->save($this->qtiRepos->getUserDir() . $this->question->getId() . '_qestion_qti.xml');
     return $this->getResponse();
 }
Esempio n. 3
0
 /**
  * Implements the abstract method
  *
  * @access public
  * @param \UJM\ExoBundle\Entity\Interaction $interaction
  * @param qtiRepository $qtiRepos
  */
 public function export(\UJM\ExoBundle\Entity\Interaction $interaction, qtiRepository $qtiRepos)
 {
     $this->qtiRepos = $qtiRepos;
     $this->question = $interaction->getQuestion();
     $this->interactionmatching = $this->doctrine->getManager()->getRepository('UJMExoBundle:InteractionMatching')->findOneBy(array('interaction' => $interaction->getId()));
     if ($this->interactionmatching->getTypeMatching() == 'To bind') {
         $this->cardinality = 'multiple';
     } else {
         $this->cardinality = 'single';
     }
     $matchingType = 'match';
     $this->qtiHead($matchingType, $this->question->getTitle());
     $this->qtiResponseDeclaration('RESPONSE', 'identifier', $this->cardinality);
     $this->qtiOutComeDeclaration();
     $this->correctResponseTag();
     $this->itemBodyTag();
     $this->matchingInteractionTag();
     $this->promptTag();
     //comment globale for this question
     if ($this->interactionmatching->getInteraction()->getFeedBack() != Null && $this->interactionmatching->getInteraction()->getFeedBack() != "") {
         $this->qtiFeedBack($interaction->getFeedBack());
     }
     $this->document->save($this->qtiRepos->getUserDir() . $this->question->getId() . '_qestion_qti.xml');
     return $this->getResponse();
 }
Esempio n. 4
0
 /**
  * Implements the abstract method
  *
  * @access public
  * @param \UJM\ExoBundle\Entity\Interaction $interaction
  * @param qtiRepository $qtiRepos
  *
  */
 public function export(\UJM\ExoBundle\Entity\Interaction $interaction, qtiRepository $qtiRepos)
 {
     $this->qtiRepos = $qtiRepos;
     $this->question = $interaction->getQuestion();
     $this->interactionopen = $this->doctrine->getManager()->getRepository('UJMExoBundle:InteractionOpen')->findOneBy(array('interaction' => $interaction->getId()));
     $this->qtiHead('extendedText', $this->question->getTitle());
     $this->qtiResponseDeclaration('RESPONSE', 'string', $this->getCardinality());
     $this->qtiOutComeDeclaration();
     $this->defaultValueTag();
     $this->itemBodyTag();
     if ($this->interactionopen->getInteraction()->getFeedBack() != Null && $this->interactionopen->getInteraction()->getFeedBack() != "") {
         $this->qtiFeedBack($interaction->getFeedBack());
     }
 }
Esempio n. 5
0
 /**
  * Implements the abstract method
  *
  * @access public
  * @param \UJM\ExoBundle\Entity\Interaction $interaction
  * @param qtiRepository $qtiRepos
  *
  */
 public function export(\UJM\ExoBundle\Entity\Interaction $interaction, qtiRepository $qtiRepos)
 {
     $this->qtiRepos = $qtiRepos;
     $this->question = $interaction->getQuestion();
     $this->interactionhole = $this->doctrine->getManager()->getRepository('UJMExoBundle:InteractionHole')->findOneBy(array('interaction' => $interaction->getId()));
     $this->qtiHead('textEntry', $this->question->getTitle());
     foreach ($this->interactionhole->getHoles() as $hole) {
         $numberBlank = $this->nbResponseDeclaration + 1;
         $this->qtiResponseDeclaration('blank_' . $numberBlank, 'string', 'single');
         $this->correctResponseTag();
         $this->mappingTag($hole);
     }
     $this->qtiOutComeDeclaration();
     $this->itemBodyTag();
     $this->promptTag();
     $this->textWithHole();
     if ($this->interactionhole->getInteraction()->getFeedBack() != Null && $this->interactionhole->getInteraction()->getFeedBack() != "") {
         $this->qtiFeedBack($interaction->getFeedBack());
     }
     $this->document->save($this->qtiRepos->getUserDir() . $this->question->getId() . '_qestion_qti.xml');
     return $this->getResponse();
 }