protected function unmarshall(DOMElement $element)
    {
        // First we retrieve the mandatory views.
        if (($value = $this->getDOMElementAttributeAs($element, 'view', 'string')) !== null) {
            $viewsArray = explode("\x20", $value);
            $viewsCollection = new ViewCollection();
            $ref = View::asArray();

            foreach ($viewsArray as $viewString) {
                $key = strtoupper(str_replace("\xf2", "\x20", $viewString));
                if (array_key_exists($key, $ref)) {
                    $viewsCollection[] = $ref[$key];
                }
            }

            $object = new RubricBlock($viewsCollection);

            if (($value = $this->getDOMElementAttributeAs($element, 'use', 'string')) !== null) {
                $object->setUse($value);
            }

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

            $stylesheets = new StylesheetCollection();
            $content = new FlowStaticCollection();

            foreach ($this->getChildElementsByTagName($element, 'apipAccessibility', true, true) as $elt) {

                if ($elt instanceof DOMText) {
                    $elt = self::getDOMCradle()->createElement('textRun', $elt->wholeText);
                }

                $marshaller = $this->getMarshallerFactory()->createMarshaller($elt);
                $cpt = $marshaller->unmarshall($elt);

                if ($cpt instanceof Stylesheet) {
                    $stylesheets[] = $cpt;
                } elseif ($cpt instanceof FlowStatic && !in_array($cpt->getQtiClassName(), array('hottext', 'feedbackBlock', 'feedbackInline', 'rubricBlock', 'infoControl'))) {
                    $content[] = $cpt;
                } else {
                    $msg = "The 'rubricBlock' cannot contain '" . $cpt->getQtiClassName() . "' elements.";
                    throw new UnmarshallingException($msg, $element);
                }
            }

            $object->setStylesheets($stylesheets);
            $object->setContent($content);

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

            return $object;
        } else {
            $msg = "The mandatory attribute 'views' is missing.";
            throw new UnmarshallingException($msg, $element);
        }
    }
protected function unmarshall(DOMElement $element)
    {
        // First we retrieve the mandatory views.
        if (($value = $this->getDOMElementAttributeAs($element, 'view', 'string')) !== null) {
            $viewsArray = explode("\x20", $value);
            $viewsCollection = new ViewCollection();
            $ref = View::asArray();

            foreach ($viewsArray as $viewString) {
                $key = strtoupper(str_replace("\xf2", "\x20", $viewString));
                if (array_key_exists($key, $ref)) {
                    $viewsCollection[] = $ref[$key];
                }
            }

            $object = new RubricBlock($viewsCollection);

            if (($value = $this->getDOMElementAttributeAs($element, 'use', 'string')) !== null) {
                $object->setUse($value);
            }

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

            $stylesheets = new StylesheetCollection();
            $content = new FlowStaticCollection();

            foreach ($this->getChildElementsByTagName($element, 'apipAccessibility', true, true) as $elt) {

                if ($elt instanceof DOMText) {
                    $elt = self::getDOMCradle()->createElement('textRun', $elt->wholeText);
                }

                $marshaller = $this->getMarshallerFactory()->createMarshaller($elt);
                $cpt = $marshaller->unmarshall($elt);

                if ($cpt instanceof Stylesheet) {
                    $stylesheets[] = $cpt;
                } elseif ($cpt instanceof FlowStatic && !in_array($cpt->getQtiClassName(), array('hottext', 'feedbackBlock', 'feedbackInline', 'rubricBlock', 'infoControl'))) {
                    $content[] = $cpt;
                } else {
                    $msg = "The 'rubricBlock' cannot contain '" . $cpt->getQtiClassName() . "' elements.";
                    throw new UnmarshallingException($msg, $element);
                }
            }

            $object->setStylesheets($stylesheets);
            $object->setContent($content);

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

            return $object;
        } else {
            $msg = "The mandatory attribute 'views' is missing.";
            throw new UnmarshallingException($msg, $element);
        }
    }
protected function unmarshall ( DOMElement $ element ) { // First we retrieve the mandatory views. if ( ( $ value = $ this -> getDOMElementAttributeAs ( $ element , 'view' , 'string' ) ) !== null ) { $ viewsArray = explode ( "\x20" , $ value ) ; $ viewsCollection = new ViewCollection ( ) ; $ ref = View :: asArray ( ) ; foreach ( $ viewsArray as $ viewString ) { $ key = strtoupper ( str_replace ( "\xf2" , "\x20" , $ viewString ) ) ; if ( array_key_exists ( $ key , $ ref ) ) { $ viewsCollection [ ] = $ ref [ $ key ] ; } } $ object = new RubricBlock ( $ viewsCollection ) ; if ( ( $ value = $ this -> getDOMElementAttributeAs ( $ element , 'use' , 'string' ) ) !== null ) { $ object -> setUse ( $ value ) ; } if ( ( $ xmlBase = static :: getXmlBase ( $ element ) ) !== false ) { $ object -> setXmlBase ( $ xmlBase ) ; } $ stylesheets = new StylesheetCollection ( ) ; $ content = new FlowStaticCollection ( ) ; foreach ( $ this -> getChildElementsByTagName ( $ element , 'apipAccessibility' , true , true ) as $ elt ) { if ( $ elt instanceof DOMText ) { $ elt = self :: getDOMCradle ( ) -> createElement ( 'textRun' , $ elt -> wholeText ) ; } $ marshaller = $ this -> getMarshallerFactory ( ) -> createMarshaller ( $ elt ) ; $ cpt = $ marshaller -> unmarshall ( $ elt ) ; if ( $ cpt instanceof Stylesheet ) { $ stylesheets [ ] = $ cpt ; } elseif ( $ cpt instanceof FlowStatic && ! in_array ( $ cpt -> getQtiClassName ( ) , array ( 'hottext' , 'feedbackBlock' , 'feedbackInline' , 'rubricBlock' , 'infoControl' ) ) ) { $ content [ ] = $ cpt ; } else { $ msg = "The 'rubricBlock' cannot contain '" . $ cpt -> getQtiClassName ( ) . "' elements." ; throw new UnmarshallingException ( $ msg , $ element ) ; } } $ object -> setStylesheets ( $ stylesheets ) ; $ object -> setContent ( $ content ) ; $ this -> fillBodyElement ( $ object , $ element ) ; return $ object ; } else { $ msg = "The mandatory attribute 'views' is missing." ; throw new UnmarshallingException ( $ msg , $ element ) ; } }
Unmarshall a DOMElement object corresponding to a QTI rubrickBlock element.

@param \DOMElement $element A DOMElement object.
@return \qtism\data\content\RubricBlock A RubricBlock object.
@throws \qtism\data\storage\xml\marshalling\UnmarshallingException If the mandatory attribute 'href' is missing from $element.
Unmarshall a DOMElement object corresponding to a QTI rubrickBlock element .