protected function unmarshall(DOMElement $element)
    {
        if (($responseIdentifier = $this->getDOMElementAttributeAs($element, 'responseIdentifier')) !== null) {

            if (($autostart = $this->getDOMElementAttributeAs($element, 'autostart', 'boolean')) !== null) {

                $objectElts = $this->getChildElementsByTagName($element, 'object');
                if (count($objectElts) > 0) {
                    $objectElt = $objectElts[0];
                    $object = $this->getMarshallerFactory()->createMarshaller($objectElt)->unmarshall($objectElt);

                    $component = new MediaInteraction($responseIdentifier, $autostart, $object);

                    $promptElts = $this->getChildElementsByTagName($element, 'prompt');
                    if (count($promptElts) > 0) {
                        $promptElt = $promptElts[0];
                        $prompt = $this->getMarshallerFactory()->createMarshaller($promptElt)->unmarshall($promptElt);
                        $component->setPrompt($prompt);
                    }

                    if (($minPlays = $this->getDOMElementAttributeAs($element, 'minPlays', 'integer')) !== null) {
                        $component->setMinPlays($minPlays);
                    }

                    if (($maxPlays = $this->getDOMElementAttributeAs($element, 'maxPlays', 'integer')) !== null) {
                        $component->setMaxPlays($maxPlays);
                    }

                    if (($loop = $this->getDOMElementAttributeAs($element, 'loop', 'boolean')) !== null) {
                        $component->setLoop($loop);
                    }

                    if (($xmlBase = self::getXmlBase($element)) !== false) {
                        $component->setXmlBase($xmlBase);
                    }

                    $this->fillBodyElement($component, $element);

                    return $component;
                } else {
                    $msg = "A 'mediaInteraction' element must contain exactly one 'object' element, none given.";
                    throw new UnmarshallingException($msg, $element);
                }
            } else {
                $msg = "The mandatory 'autostart' attribute is missing from the 'mediaInteraction' element.";
                throw new UnmarshallingException($msg, $element);
            }
        } else {
            $msg = "The mandatory 'responseIdentifier' attribute is missing from the 'mediaInteraction' element.";
            throw new UnmarshallingException($msg, $element);
        }
    }
protected function unmarshall(DOMElement $element)
    {
        if (($responseIdentifier = $this->getDOMElementAttributeAs($element, 'responseIdentifier')) !== null) {

            if (($autostart = $this->getDOMElementAttributeAs($element, 'autostart', 'boolean')) !== null) {

                $objectElts = $this->getChildElementsByTagName($element, 'object');
                if (count($objectElts) > 0) {
                    $objectElt = $objectElts[0];
                    $object = $this->getMarshallerFactory()->createMarshaller($objectElt)->unmarshall($objectElt);

                    $component = new MediaInteraction($responseIdentifier, $autostart, $object);

                    $promptElts = $this->getChildElementsByTagName($element, 'prompt');
                    if (count($promptElts) > 0) {
                        $promptElt = $promptElts[0];
                        $prompt = $this->getMarshallerFactory()->createMarshaller($promptElt)->unmarshall($promptElt);
                        $component->setPrompt($prompt);
                    }

                    if (($minPlays = $this->getDOMElementAttributeAs($element, 'minPlays', 'integer')) !== null) {
                        $component->setMinPlays($minPlays);
                    }

                    if (($maxPlays = $this->getDOMElementAttributeAs($element, 'maxPlays', 'integer')) !== null) {
                        $component->setMaxPlays($maxPlays);
                    }

                    if (($loop = $this->getDOMElementAttributeAs($element, 'loop', 'boolean')) !== null) {
                        $component->setLoop($loop);
                    }

                    if (($xmlBase = self::getXmlBase($element)) !== false) {
                        $component->setXmlBase($xmlBase);
                    }

                    $this->fillBodyElement($component, $element);

                    return $component;
                } else {
                    $msg = "A 'mediaInteraction' element must contain exactly one 'object' element, none given.";
                    throw new UnmarshallingException($msg, $element);
                }
            } else {
                $msg = "The mandatory 'autostart' attribute is missing from the 'mediaInteraction' element.";
                throw new UnmarshallingException($msg, $element);
            }
        } else {
            $msg = "The mandatory 'responseIdentifier' attribute is missing from the 'mediaInteraction' element.";
            throw new UnmarshallingException($msg, $element);
        }
    }
protected function unmarshall ( DOMElement $ element ) { if ( ( $ responseIdentifier = $ this -> getDOMElementAttributeAs ( $ element , 'responseIdentifier' ) ) !== null ) { if ( ( $ autostart = $ this -> getDOMElementAttributeAs ( $ element , 'autostart' , 'boolean' ) ) !== null ) { $ objectElts = $ this -> getChildElementsByTagName ( $ element , 'object' ) ; if ( count ( $ objectElts ) > 0 ) { $ objectElt = $ objectElts [ 0 ] ; $ object = $ this -> getMarshallerFactory ( ) -> createMarshaller ( $ objectElt ) -> unmarshall ( $ objectElt ) ; $ component = new MediaInteraction ( $ responseIdentifier , $ autostart , $ object ) ; $ promptElts = $ this -> getChildElementsByTagName ( $ element , 'prompt' ) ; if ( count ( $ promptElts ) > 0 ) { $ promptElt = $ promptElts [ 0 ] ; $ prompt = $ this -> getMarshallerFactory ( ) -> createMarshaller ( $ promptElt ) -> unmarshall ( $ promptElt ) ; $ component -> setPrompt ( $ prompt ) ; } if ( ( $ minPlays = $ this -> getDOMElementAttributeAs ( $ element , 'minPlays' , 'integer' ) ) !== null ) { $ component -> setMinPlays ( $ minPlays ) ; } if ( ( $ maxPlays = $ this -> getDOMElementAttributeAs ( $ element , 'maxPlays' , 'integer' ) ) !== null ) { $ component -> setMaxPlays ( $ maxPlays ) ; } if ( ( $ loop = $ this -> getDOMElementAttributeAs ( $ element , 'loop' , 'boolean' ) ) !== null ) { $ component -> setLoop ( $ loop ) ; } if ( ( $ xmlBase = self :: getXmlBase ( $ element ) ) !== false ) { $ component -> setXmlBase ( $ xmlBase ) ; } $ this -> fillBodyElement ( $ component , $ element ) ; return $ component ; } else { $ msg = "A 'mediaInteraction' element must contain exactly one 'object' element, none given." ; throw new UnmarshallingException ( $ msg , $ element ) ; } } else { $ msg = "The mandatory 'autostart' attribute is missing from the 'mediaInteraction' element." ; throw new UnmarshallingException ( $ msg , $ element ) ; } } else { $ msg = "The mandatory 'responseIdentifier' attribute is missing from the 'mediaInteraction' element." ; throw new UnmarshallingException ( $ msg , $ element ) ; } }
Unmarshall a DOMElement object corresponding to a MediaInteraction element.

@param \DOMElement $element A DOMElement object.
@return \qtism\data\QtiComponent A MediaInteraction object.
@throws \qtism\data\storage\xml\marshalling\UnmarshallingException
Unmarshall a DOMElement object corresponding to a MediaInteraction element .