protected function unmarshall(DOMElement $element)
    {
        if (($max = $this->getDOMElementAttributeAs($element, 'max', 'string')) !== null) {
            $max = (Format::isVariableRef($max)) ? $max : intval($max);
            $object = new RandomInteger(0, $max);

            if (($step = $this->getDOMElementAttributeAs($element, 'step')) !== null) {
                $object->setStep(abs(intval($step)));
            }

            if (($min = $this->getDOMElementAttributeAs($element, 'min')) !== null) {
                $min = (Format::isVariableRef($min)) ? $min : intval($min);
                $object->setMin($min);
            }

            return $object;
        } else {
            $msg = "The mandatory attribute 'max' is missing from element '" . $element->localName . "'.";
            throw new UnmarshallingException($msg, $element);
        }
    }
protected function unmarshall(DOMElement $element)
    {
        if (($max = $this->getDOMElementAttributeAs($element, 'max', 'string')) !== null) {
            $max = (Format::isVariableRef($max)) ? $max : intval($max);
            $object = new RandomInteger(0, $max);

            if (($step = $this->getDOMElementAttributeAs($element, 'step')) !== null) {
                $object->setStep(abs(intval($step)));
            }

            if (($min = $this->getDOMElementAttributeAs($element, 'min')) !== null) {
                $min = (Format::isVariableRef($min)) ? $min : intval($min);
                $object->setMin($min);
            }

            return $object;
        } else {
            $msg = "The mandatory attribute 'max' is missing from element '" . $element->localName . "'.";
            throw new UnmarshallingException($msg, $element);
        }
    }
protected function unmarshall ( DOMElement $ element ) { if ( ( $ max = $ this -> getDOMElementAttributeAs ( $ element , 'max' , 'string' ) ) !== null ) { $ max = ( Format :: isVariableRef ( $ max ) ) ? $ max : intval ( $ max ) ; $ object = new RandomInteger ( 0 , $ max ) ; if ( ( $ step = $ this -> getDOMElementAttributeAs ( $ element , 'step' ) ) !== null ) { $ object -> setStep ( abs ( intval ( $ step ) ) ) ; } if ( ( $ min = $ this -> getDOMElementAttributeAs ( $ element , 'min' ) ) !== null ) { $ min = ( Format :: isVariableRef ( $ min ) ) ? $ min : intval ( $ min ) ; $ object -> setMin ( $ min ) ; } return $ object ; } else { $ msg = "The mandatory attribute 'max' is missing from element '" . $ element -> localName . "'." ; throw new UnmarshallingException ( $ msg , $ element ) ; } }
Unmarshall a DOMElement object corresponding to a QTI randomInteger element.

@param \DOMElement $element A DOMElement object.
@return \qtism\data\QtiComponent A RandomInteger object.
@throws \qtism\data\storage\xml\marshalling\UnmarshallingException If the mandatory attributes 'min' or 'max' are missing from $element.
Unmarshall a DOMElement object corresponding to a QTI randomInteger element .