public function __construct($attributes = array(), Item $relatedItem = null, $serial = '')
 {
     parent::__construct($attributes, $relatedItem, $serial);
     if (class_exists(static::$containerType)) {
         $this->body = new static::$containerType('', $relatedItem);
     } else {
         throw new QtiModelException('The container class does not exist: ' . static::$containerType);
     }
 }
 public function getBaseType()
 {
     $returnValue = parent::getBaseType();
     $response = $this->getResponse();
     if (!is_null($response)) {
         $authorizedBaseType = array('string', 'integer', 'float');
         $baseType = strtolower($response->getAttributeValue('baseType'));
         if (in_array($baseType, $authorizedBaseType)) {
             $returnValue = $baseType;
         }
     }
     return $returnValue;
 }
 protected function getUsedAttributes()
 {
     return array_merge(parent::getUsedAttributes(), array('oat\\taoQtiItem\\model\\qti\\attribute\\TypeUploadInteraction'));
 }
 protected function getUsedAttributes()
 {
     return array_merge(parent::getUsedAttributes(), array('oat\\taoQtiItem\\model\\qti\\attribute\\Shuffle', 'oat\\taoQtiItem\\model\\qti\\attribute\\MaxAssociations', 'oat\\taoQtiItem\\model\\qti\\attribute\\MinAssociations'));
 }
 protected function getUsedAttributes()
 {
     return array_merge(parent::getUsedAttributes(), array('oat\\taoQtiItem\\model\\qti\\attribute\\Shuffle', 'oat\\taoQtiItem\\model\\qti\\attribute\\MaxChoices', 'oat\\taoQtiItem\\model\\qti\\attribute\\MinChoices', 'oat\\taoQtiItem\\model\\qti\\attribute\\Orientation'));
 }
 protected function getTemplateQtiVariables()
 {
     $variables = parent::getTemplateQtiVariables();
     $variables['object'] = $this->object->toQTI();
     return $variables;
 }
 public function getComposingElements($className = '')
 {
     if ($className === '') {
         $className = 'oat\\taoQtiItem\\model\\qti\\Element';
     }
     $returnValue = parent::getComposingElements($className);
     //for matchInteraction choices is not an array of Element but an array of array of Element
     foreach ($this->getChoices(0) as $choice) {
         if ($choice instanceof Element) {
             if ($choice instanceof $className) {
                 $returnValue[$choice->getSerial()] = $choice;
             }
             $returnValue = array_merge($returnValue, $choice->getComposingElements($className));
         }
     }
     foreach ($this->getChoices(1) as $choice) {
         if ($choice instanceof Element) {
             if ($choice instanceof $className) {
                 $returnValue[$choice->getSerial()] = $choice;
             }
             $returnValue = array_merge($returnValue, $choice->getComposingElements($className));
         }
     }
     return $returnValue;
 }