protected function loadChoiceData(Choice $choice, $data)
 {
     if ($choice instanceof TextVariableChoice && isset($data['text'])) {
         $choice->setContent($data['text']);
     }
 }
 public function removeChoice(Choice $choice, $setNumber = null)
 {
     if (!is_null($setNumber) && isset($this->choices[$setNumber])) {
         unset($this->choices[$setNumber][$choice->getSerial()]);
     } else {
         for ($i = 0; $i < 2; $i++) {
             $this->removeChoice($choice, $i);
         }
     }
 }
 public function removeChoice(Choice $choice, $setNumber = null)
 {
     if ($choice instanceof GapImg) {
         unset($this->gapImgs[$choice->getSerial()]);
     } else {
         parent::removeChoice($choice);
     }
 }
 public function __construct($attributes = array(), Item $relatedItem = null, $serial = '')
 {
     parent::__construct($attributes, $relatedItem, $serial);
     $this->body = new ContainerStatic();
 }
Beispiel #5
0
 protected function getUsedAttributes()
 {
     return array_merge(parent::getUsedAttributes(), array('oat\\taoQtiItem\\model\\qti\\attribute\\Required'));
 }
 /**
  * Remove a choice from the interaction
  * 
  * @param oat\taoQtiItem\model\qti\choice\Choice $choice
  * @param mixed $setNumber
  */
 public function removeChoice(Choice $choice, $setNumber = null)
 {
     unset($this->choices[$choice->getSerial()]);
 }
 public function toArray($filterVariableContent = false, &$filtered = array())
 {
     $returnValue = parent::toArray($filterVariableContent, $filtered);
     $returnValue['text'] = (string) $this->text;
     return $returnValue;
 }
 public function toArray($filterVariableContent = false, &$filtered = array())
 {
     $returnValue = parent::toArray($filterVariableContent, $filtered);
     $returnValue['object'] = $this->object->toArray($filterVariableContent, $filtered);
     return $returnValue;
 }