/**
  * Fill $element with the attributes of $bodyElement.
  *
  * @param DOMElement $element The element from where the atribute values will be
  * @param BodyElement $bodyElement The bodyElement to be fill.
  */
 protected function fillElement(DOMElement $element, BodyElement $bodyElement)
 {
     if (($id = $bodyElement->getId()) !== '') {
         $element->setAttribute('id', $id);
     }
     if (($class = $bodyElement->getClass()) !== '') {
         $element->setAttribute('class', $class);
     }
     if (($lang = $bodyElement->getLang()) !== '') {
         $element->setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:lang', $lang);
     }
     if (($label = $bodyElement->getLabel()) != '') {
         $element->setAttribute('label', $label);
     }
 }
Beispiel #2
0
 /**
  * Fill $element with the attributes of $bodyElement.
  *
  * @param DOMElement $element The element from where the atribute values will be
  * @param BodyElement $bodyElement The bodyElement to be fill.
  */
 protected function fillElement(DOMElement $element, BodyElement $bodyElement)
 {
     if (($id = $bodyElement->getId()) !== '') {
         $element->setAttribute('id', $id);
     }
     if (($class = $bodyElement->getClass()) !== '') {
         $element->setAttribute('class', $class);
     }
     if (($lang = $bodyElement->getLang()) !== '') {
         $element->setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:lang', $lang);
     }
     if (($label = $bodyElement->getLabel()) != '') {
         $element->setAttribute('label', $label);
     }
     $version = $this->getVersion();
     if (Version::compare($version, '2.2.0', '>=') === true && ($dir = $bodyElement->getDir()) !== Direction::AUTO && in_array($bodyElement->getQtiClassName(), self::$dirClasses) === true) {
         $element->setAttribute('dir', Direction::getNameByConstant($dir));
     }
 }