Marshall an InterpolationTable object into a DOMElement object.

@param \qtism\data\QtiComponent $component An InterpolationTable object.
@return \DOMElement The according DOMElement object.
420747
protected function marshall(QtiComponent $component)
    {
        $element = static::getDOMCradle()->createElement($component->getQtiClassName());
        foreach ($component->getInterpolationTableEntries() as $interpolationTableEntry) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($interpolationTableEntry, array($this->getBaseType()));
            $element->appendChild($marshaller->marshall($interpolationTableEntry));
        }

        if ($component->getDefaultValue() !== null) {
            $this->setDOMElementAttribute($element, 'defaultValue', $component->getDefaultValue());
        }

        return $element;
    }
831572
public function processElement(\DOMElement $element, ContextInterface $context)
    {
        // Create a property
        $propertyContext = $this->processProperty($element, $context);

        // Process the element in case it's an anonymous thing with no children
        if (!$element->childNodes->length) {
            $this->processChild($element, $context);
        }

        return $propertyContext;
    }
154027
protected function marshall(QtiComponent $component)
    {
        $element = self::getDOMCradle()->createElement($component->getQtiClassName());

        if ($component->hasTemplate() === true) {
            $this->setDOMElementAttribute($element, 'template', $component->getTemplate());
        }

        if ($component->hasTemplateLocation() === true) {
            $this->setDOMElementAttribute($element, 'templateLocation', $component->getTemplateLocation());
        }

        foreach ($component->getResponseRules() as $responseRule) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($responseRule);
            $element->appendChild($marshaller->marshall($responseRule));
        }

        return $element;
    }
721136
public function add(HtmlComponent $component)
    {

        if (isset($this->components[$component->id]) || isset($this->components[$component->id . ":" . $this->number])) {
            //   $id = substr($component->id,0,strpos($component->id,':'));
            //   $pid = substr($this->id,0,strpos($this->id,':'));
            throw new ZE(sprintf(ERROR_DATAROW_COMPONENT_EXISTS, $component->id, $pid));
        }
        $this->components[$component->id] = $component;
        $component->setOwner($this);
        return $component;
    }
400266
public function addComponent(ComponentInterface $component)
    {
        $component->preMergeParams($this);
        return $this->overwriteWith($component->toArray());
    }
842359
protected function marshall(QtiComponent $component)
    {
        return self::getDOMCradle()->importNode($component->getXml()->documentElement, true);
    }
1284484
public function marshall(QtiComponent $component)
    {
        $element = self::getDOMCradle()->createElement($component->getQtiClassName());
        $this->setDOMElementAttribute($element, 'identifier', $component->getIdentifier());
        $this->setDOMElementAttribute($element, 'minConstraint', $component->getMinConstraint());
        $this->setDOMElementAttribute($element, 'maxConstraint', $component->getMaxConstraint());

        return $element;
    }
211108
protected function marshall(QtiComponent $component)
    {
        $element = parent::marshall($component);

        $this->setDOMElementAttribute($element, 'href', $component->getHref());

        // Deal with categories.
        $categories = $component->getCategories();
        if (count($categories) > 0) {
            $this->setDOMElementAttribute($element, 'category', implode("\x20", $categories->getArrayCopy()));
        }

        // Deal with variableMappings.
        $variableMappings = $component->getVariableMappings();
        foreach ($variableMappings as $mapping) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($mapping);
            $element->appendChild($marshaller->marshall($mapping));
        }

        // Deal with weights.
        $weights = $component->getWeights();
        foreach ($weights as $weight) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($weight);
            $element->appendChild($marshaller->marshall($weight));
        }

        // Deal with templateDefaults.
        $templateDefaults = $component->getTemplateDefaults();
        foreach ($templateDefaults as $default) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($default);
            $element->appendChild($marshaller->marshall($default));
        }

        return $element;
    }
1230780
protected function marshall(QtiComponent $component)
    {
        $element = parent::marshall($component);

        foreach ($component->getResponseDeclarations() as $responseDeclaration) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($responseDeclaration);
            $element->appendChild($marshaller->marshall($responseDeclaration));
        }

        foreach ($component->getOutcomeDeclarations() as $outcomeDeclaration) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($outcomeDeclaration);
            $element->appendChild($marshaller->marshall($outcomeDeclaration));
        }
        
        foreach ($component->getTemplateDeclarations() as $templateDeclaration) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($templateDeclaration);
            $element->appendChild($marshaller->marshall($templateDeclaration));
        }
        
        if ($component->hasTemplateProcessing() === true) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($component->getTemplateProcessing());
            $templProcElt = $marshaller->marshall($component->getTemplateProcessing());
            $element->appendChild($templProcElt);
        }
        
        if ($component->hasResponseProcessing() === true) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($component->getResponseProcessing());
            $respProcElt = $marshaller->marshall($component->getResponseProcessing());
            $element->appendChild($respProcElt);
        }
        
        foreach ($component->getModalFeedbackRules() as $modalFeedbackRule) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($modalFeedbackRule);
            $element->appendChild($marshaller->marshall($modalFeedbackRule));
        }
        
        foreach ($component->getShufflings() as $shuffling) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($shuffling);
            $element->appendChild($marshaller->marshall($shuffling));
        }
        
        foreach ($component->getResponseValidityConstraints() as $responseValidityConstraint) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($responseValidityConstraint);
            $element->appendChild($marshaller->marshall($responseValidityConstraint));
        }
        
        $this->setDOMElementAttribute($element, 'adaptive', $component->isAdaptive());
        $this->setDOMElementAttribute($element, 'timeDependent', $component->isTimeDependent());
        
        $endAttemptIdentifiers = $component->getEndAttemptIdentifiers();
        if (count($endAttemptIdentifiers) > 0) {
            $this->setDOMElementAttribute($element, 'endAttemptIdentifiers', implode("\x20", $endAttemptIdentifiers->getArrayCopy()));
        }

        return $element;
    }
27871
public static function fromComponent(IColumnComponent $component) : ChartAxis
    {
        return new self($component->getName(), $component->getLabel(), [$component]);
    }
1292035
protected function marshall(QtiComponent $component)
    {
        $element = $this->createElement($component);

        $arrayViews = array();
        foreach ($component->getViews() as $view) {
            $key = array_search($view, View::asArray());
            // replace '_' by the space char.
            $arrayViews[] = strtolower(str_replace("\xf2", "\x20", $key));
        }

        if (count($arrayViews) > 0) {
            $this->setDOMElementAttribute($element, 'view', implode("\x20", $arrayViews));
        }

        if ($component->getUse() != '') {
            $this->setDOMElementAttribute($element, 'use', $component->getUse());
        }

        if ($component->hasXmlBase() === true) {
            static::setXmlBase($element, $component->getXmlBase());
        }

        foreach ($component->getContent() as $block) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($block);
            $element->appendChild($marshaller->marshall($block));
        }

        foreach ($component->getStylesheets() as $stylesheet) {
            $stylesheetMarshaller = $this->getMarshallerFactory()->createMarshaller($stylesheet);
            $element->appendChild($stylesheetMarshaller->marshall($stylesheet));
        }

        $this->fillElement($element, $component);

        return $element;
    }
570954
public function reset_component( $component )
    {
        $component->value = $component->default;
        $this->final_instance[$component->name] = $component->default;
        return $this->final_instance;
    }
343040
protected function marshall(QtiComponent $component)
    {
        $element = self::getDOMCradle()->createElement('br');

        if ($component->hasXmlBase() === true) {
            self::setXmlBase($element, $component->setXmlBase());
        }

        $this->fillElement($element, $component);

        return $element;
    }
43461
protected function marshall(QtiComponent $component)
    {
        $element = self::getDOMCradle()->createElement('col');

        if ($component->getSpan() !== 1) {
            $this->setDOMElementAttribute($element, 'span', $component->getSpan());
        }

        $this->fillElement($element, $component);

        return $element;
    }
1266748
public function marshall(QtiComponent $component)
    {
        $element = self::getDOMCradle()->createElement('rubricBlockRef');
        $this->setDOMElementAttribute($element, 'identifier', $component->getIdentifier());
        $this->setDOMElementAttribute($element, 'href', $component->getHref());

        return $element;
    }
1215835
public static function build($component, array $options = [])
    {
        if (is_array($component)) {
            return implode(', ', $component);
        }

        return $component->old . ' TO ' . $component->new;
    }
104563
protected function marshall(QtiComponent $component)
    {
        $element = static::getDOMCradle()->createElement($component->getQtiClassName());

        if ($component->hasMinTime() === true) {
            $this->setDOMElementAttribute($element, 'minTime', $component->getMinTime()->getSeconds(true));
        }

        if ($component->hasMaxTime() === true) {
            $this->setDOMElementAttribute($element, 'maxTime', $component->getMaxTime()->getSeconds(true));
        }

        $this->setDOMElementAttribute($element, 'allowLateSubmission', $component->doesAllowLateSubmission());

        return $element;
    }