Beispiel #1
0
 /**
  * add the tag simpleChoice in choiceInteraction.
  *
  *
  * @param \UJM\ExoBundle\Entity\Choice $choice
  * @param int                          $choiceNumber
  */
 private function simpleChoiceTag($choice, $choiceNumber)
 {
     $simpleChoice = $this->document->CreateElement('simpleChoice');
     $simpleChoice->setAttribute('identifier', 'Choice' . $choiceNumber);
     $this->choiceInteraction->appendChild($simpleChoice);
     if ($choice->getPositionForce() == 1) {
         $positionForced = 'true';
     } else {
         $positionForced = 'false';
     }
     $simpleChoice->setAttribute('fixed', $positionForced);
     $this->getDomEl($simpleChoice, $choice->getLabel());
     //comment per line for each choice
     if ($choice->getFeedback() != null && $choice->getFeedback() != '') {
         $feedbackInline = $this->document->CreateElement('feedbackInline');
         $feedbackInline->setAttribute('outcomeIdentifier', 'FEEDBACK');
         $feedbackInline->setAttribute('identifier', 'Choice' . $choiceNumber);
         $feedbackInline->setAttribute('showHide', 'show');
         $this->getDomEl($feedbackInline, $choice->getFeedback());
         $simpleChoice->appendChild($feedbackInline);
     }
 }
Beispiel #2
0
 /**
  * add the tag simpleChoice in choiceInteraction
  *
  * @access private
  *
  * @param \UJM\ExoBundle\Entity\Choice $choice
  * @param Integer $choiceNumber
  *
  */
 private function simpleChoiceTag($choice, $choiceNumber)
 {
     $simpleChoice = $this->document->CreateElement('simpleChoice');
     $simpleChoice->setAttribute("identifier", "Choice" . $choiceNumber);
     $this->choiceInteraction->appendChild($simpleChoice);
     $simpleChoicetxt = $this->document->CreateTextNode($choice->getLabel());
     if ($choice->getPositionForce() == 1) {
         $positionForced = 'true';
     } else {
         $positionForced = 'false';
     }
     $simpleChoice->setAttribute("fixed", $positionForced);
     $simpleChoice->appendChild($simpleChoicetxt);
     //comment per line for each choice
     if ($choice->getFeedback() != Null && $choice->getFeedback() != "") {
         $feedbackInline = $this->document->CreateElement('feedbackInline');
         $feedbackInline->setAttribute("outcomeIdentifier", "FEEDBACK");
         $feedbackInline->setAttribute("identifier", "Choice" . $choiceNumber);
         $feedbackInline->setAttribute("showHide", "show");
         $feedbackInlinetxt = $this->document->CreateTextNode($choice->getFeedback());
         $feedbackInline->appendChild($feedbackInlinetxt);
         $simpleChoice->appendChild($feedbackInline);
     }
 }