Exemplo n.º 1
0
 /**
  * Marshall a VariableMapping object into a DOMElement object.
  *
  * @param \qtism\data\QtiComponent $component A VariableMapping object.
  * @return \DOMElement The according DOMElement object.
  */
 protected function marshall(QtiComponent $component)
 {
     $element = static::getDOMCradle()->createElement($component->getQtiClassName());
     self::setDOMElementAttribute($element, 'sourceIdentifier', $component->getSource());
     self::setDOMElementAttribute($element, 'targetIdentifier', $component->getTarget());
     return $element;
 }
 /**
  * Marshall a BranchRule object into a DOMElement object.
  * 
  * @param QtiComponent $component A BranchRule object.
  * @return DOMElement The according DOMElement object.
  */
 protected function marshall(QtiComponent $component)
 {
     $element = static::getDOMCradle()->createElement($component->getQtiClassName());
     $marshaller = $this->getMarshallerFactory()->createMarshaller($component->getExpression());
     $element->appendChild($marshaller->marshall($component->getExpression()));
     static::setDOMElementAttribute($element, 'target', $component->getTarget());
     return $element;
 }