Ejemplo n.º 1
0
 /**
  * @see \qtism\data\storage\xml\marshalling\OperatorMarshaller::marshallChildrenKnown()
  */
 protected function marshallChildrenKnown(QtiComponent $component, array $elements)
 {
     $element = self::getDOMCradle()->createElement($component->getQtiClassName());
     self::setDOMElementAttribute($element, 'toleranceMode', ToleranceMode::getNameByConstant($component->getToleranceMode()));
     $tolerance = $component->getTolerance();
     if (!empty($tolerance)) {
         self::setDOMElementAttribute($element, 'tolerance', implode(" ", $tolerance));
     }
     if ($component->doesIncludeLowerBound() === false) {
         self::setDOMElementAttribute($element, 'includeLowerBound', false);
     }
     if ($component->doesIncludeUpperBound() === false) {
         self::setDOMElementAttribute($element, 'includeUpperBound', false);
     }
     foreach ($elements as $elt) {
         $element->appendChild($elt);
     }
     return $element;
 }