protected function unmarshall(DOMElement $element)
    {
        $interpretation = $this->getDOMElementAttributeAs($element, 'interpretation', 'string');
        $interpretation = (empty($interpretation)) ? '' : $interpretation;

        // Retrieve the values ...
        $values = new ValueCollection();
        $valueElements = $element->getElementsByTagName('value');

        if ($valueElements->length > 0) {

            for ($i = 0; $i < $valueElements->length; $i++) {
                $valueMarshaller = $this->getMarshallerFactory()->createMarshaller($valueElements->item($i), array($this->getBaseType()));
                $values[] = $valueMarshaller->unmarshall($valueElements->item($i));
            }

            $object = new DefaultValue($values, $interpretation);

            return $object;
        } else {
            $msg = "A 'defaultValue' QTI element must contain at least one 'value' QTI element.";
            throw new UnmarshallingException($msg, $element);
        }

    }
protected function unmarshall(DOMElement $element)
    {
        $interpretation = $this->getDOMElementAttributeAs($element, 'interpretation', 'string');
        $interpretation = (empty($interpretation)) ? '' : $interpretation;

        // Retrieve the values ...
        $values = new ValueCollection();
        $valueElements = $element->getElementsByTagName('value');

        if ($valueElements->length > 0) {

            for ($i = 0; $i < $valueElements->length; $i++) {
                $valueMarshaller = $this->getMarshallerFactory()->createMarshaller($valueElements->item($i), array($this->getBaseType()));
                $values[] = $valueMarshaller->unmarshall($valueElements->item($i));
            }

            $object = new DefaultValue($values, $interpretation);

            return $object;
        } else {
            $msg = "A 'defaultValue' QTI element must contain at least one 'value' QTI element.";
            throw new UnmarshallingException($msg, $element);
        }

    }
protected function unmarshall ( DOMElement $ element ) { $ interpretation = $ this -> getDOMElementAttributeAs ( $ element , 'interpretation' , 'string' ) ; $ interpretation = ( empty ( $ interpretation ) ) ? '' : $ interpretation ; // Retrieve the values ... $ values = new ValueCollection ( ) ; $ valueElements = $ element -> getElementsByTagName ( 'value' ) ; if ( $ valueElements -> length > 0 ) { for ( $ i = 0 ; $ i < $ valueElements -> length ; $ i ++ ) { $ valueMarshaller = $ this -> getMarshallerFactory ( ) -> createMarshaller ( $ valueElements -> item ( $ i ) , array ( $ this -> getBaseType ( ) ) ) ; $ values [ ] = $ valueMarshaller -> unmarshall ( $ valueElements -> item ( $ i ) ) ; } $ object = new DefaultValue ( $ values , $ interpretation ) ; return $ object ; } else { $ msg = "A 'defaultValue' QTI element must contain at least one 'value' QTI element." ; throw new UnmarshallingException ( $ msg , $ element ) ; } }
Unmarshall a DOMElement object corresponding to a QTI defaultValue element.

@param \DOMElement $element A DOMElement object.
@return \qtism\data\QtiComponent A DefaultValue object.
@throws \qtism\data\storage\xml\marshalling\UnmarshallingException If the DOMElement object cannot be unmarshalled in a valid DefaultValue object.
Unmarshall a DOMElement object corresponding to a QTI defaultValue element .