Exemplo n.º 1
0
 /**
  * Unmarshall a QTI statsOperator operator element into a StatsOperator object.
  *
  * @param \DOMElement The statsOperator element to unmarshall.
  * @param \qtism\data\QtiComponentCollection A collection containing the child Expression objects composing the Operator.
  * @return \qtism\data\QtiComponent A StatsOperator object.
  * @throws \qtism\data\storage\xml\marshalling\UnmarshallingException
  */
 protected function unmarshallChildrenKnown(DOMElement $element, QtiComponentCollection $children)
 {
     if (($name = static::getDOMElementAttributeAs($element, 'name')) !== null) {
         $object = new StatsOperator($children, Statistics::getConstantByName($name));
         return $object;
     } else {
         $msg = "The mandatory attribute 'name' is missing from element '" . $element->localName . "'.";
         throw new UnmarshallingException($msg, $element);
     }
 }