protected function unmarshall(DOMElement $element, ResponseProcessing $responseProcessing = null)
    {
        $responseRuleElts = self::getChildElements($element);

        $responseRules = new ResponseRuleCollection();
        for ($i = 0; $i < count($responseRuleElts); $i++) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($responseRuleElts[$i]);
            $responseRules[] = $marshaller->unmarshall($responseRuleElts[$i]);
        }

        if (is_null($responseProcessing) === true) {
            $object = new ResponseProcessing($responseRules);
        } else {
            $object = $responseProcessing;
            $object->setResponseRules($responseRules);
        }

        if (($template = $this->getDOMElementAttributeAs($element, 'template')) !== null) {
            $object->setTemplate($template);
        }

        if (($templateLocation = $this->getDOMElementAttributeAs($element, 'templateLocation')) !== null) {
            $object->setTemplateLocation($templateLocation);
        }

        return $object;
    }
protected function unmarshall(DOMElement $element, ResponseProcessing $responseProcessing = null)
    {
        $responseRuleElts = self::getChildElements($element);

        $responseRules = new ResponseRuleCollection();
        for ($i = 0; $i < count($responseRuleElts); $i++) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($responseRuleElts[$i]);
            $responseRules[] = $marshaller->unmarshall($responseRuleElts[$i]);
        }

        if (is_null($responseProcessing) === true) {
            $object = new ResponseProcessing($responseRules);
        } else {
            $object = $responseProcessing;
            $object->setResponseRules($responseRules);
        }

        if (($template = $this->getDOMElementAttributeAs($element, 'template')) !== null) {
            $object->setTemplate($template);
        }

        if (($templateLocation = $this->getDOMElementAttributeAs($element, 'templateLocation')) !== null) {
            $object->setTemplateLocation($templateLocation);
        }

        return $object;
    }
protected function unmarshall ( DOMElement $ element , ResponseProcessing $ responseProcessing = null ) { $ responseRuleElts = self :: getChildElements ( $ element ) ; $ responseRules = new ResponseRuleCollection ( ) ; for ( $ i = 0 ; $ i < count ( $ responseRuleElts ) ; $ i ++ ) { $ marshaller = $ this -> getMarshallerFactory ( ) -> createMarshaller ( $ responseRuleElts [ $ i ] ) ; $ responseRules [ ] = $ marshaller -> unmarshall ( $ responseRuleElts [ $ i ] ) ; } if ( is_null ( $ responseProcessing ) === true ) { $ object = new ResponseProcessing ( $ responseRules ) ; } else { $ object = $ responseProcessing ; $ object -> setResponseRules ( $ responseRules ) ; } if ( ( $ template = $ this -> getDOMElementAttributeAs ( $ element , 'template' ) ) !== null ) { $ object -> setTemplate ( $ template ) ; } if ( ( $ templateLocation = $ this -> getDOMElementAttributeAs ( $ element , 'templateLocation' ) ) !== null ) { $ object -> setTemplateLocation ( $ templateLocation ) ; } return $ object ; }
Unmarshall a DOMElement object corresponding to a QTI responseProcessing element.

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