/** * Marshall an PositionObjectInteraction object into a DOMElement object. * * @param QtiComponent $component A PositionObjectInteraction object. * @return DOMElement The according DOMElement object. * @throws MarshallingException */ protected function marshall(QtiComponent $component) { $element = self::getDOMCradle()->createElement('positionObjectInteraction'); $element->appendChild($this->getMarshallerFactory()->createMarshaller($component->getObject())->marshall($component->getObject())); self::setDOMElementAttribute($element, 'responseIdentifier', $component->getResponseIdentifier()); self::setDOMElementAttribute($element, 'maxChoices', $component->getMaxChoices()); if ($component->hasMinChoices() === true) { self::setDOMElementAttribute($element, 'minChoices', $component->getMinChoices()); } if ($component->hasCenterPoint() === true) { $centerPoint = $component->getCenterPoint(); self::setDOMElementAttribute($element, 'centerPoint', $centerPoint->getX() . " " . $centerPoint->getY()); } self::fillElement($element, $component); return $element; }
/** * Marshall an PositionObjectStage object into a DOMElement object. * * @param QtiComponent $component A PositionObjectStage object. * @return DOMElement The according DOMElement object. * @throws MarshallingException */ protected function marshall(QtiComponent $component) { $element = self::getDOMCradle()->createElement('positionObjectStage'); $object = $component->getObject(); $element->appendChild($this->getMarshallerFactory()->createMarshaller($object)->marshall($object)); foreach ($component->getPositionObjectInteractions() as $interaction) { $element->appendChild($this->getMarshallerFactory()->createMarshaller($interaction)->marshall($interaction)); } return $element; }
/** * @see \qtism\data\storage\xml\marshalling\RecursiveMarshaller::getChildrenComponents() */ protected function getChildrenComponents(QtiComponent $component) { if ($component instanceof SimpleInline) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof AtomicBlock) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof Tr) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof Td) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof Th) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof Caption) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof Ul) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof Ol) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof Li) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof Dl) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof DlElement) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof Object) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof Div) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof ItemBody) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof Blockquote) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof SimpleChoice) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof SimpleAssociableChoice) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof SimpleMatchSet) { return $component->getSimpleAssociableChoices()->getArrayCopy(); } elseif ($component instanceof GapText) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof GapImg) { return array($component->getObject()); } elseif ($component instanceof ChoiceInteraction) { return $component->getSimpleChoices()->getArrayCopy(); } elseif ($component instanceof OrderInteraction) { return $component->getSimpleChoices()->getArrayCopy(); } elseif ($component instanceof AssociateInteraction) { return $component->getSimpleAssociableChoices()->getArrayCopy(); } elseif ($component instanceof GapMatchInteraction) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof InlineChoiceInteraction) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof HotspotInteraction) { return $component->getHotspotChoices()->getArrayCopy(); } elseif ($component instanceof GraphicAssociateInteraction) { return $component->getAssociableHotspots()->getArrayCopy(); } elseif ($component instanceof InlineChoice) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof MatchInteraction) { return $component->getSimpleMatchSets()->getArrayCopy(); } elseif ($component instanceof Prompt) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof FeedbackBlock) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof TemplateBlock) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof TemplateInline) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof Hottext) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof HottextInteraction) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof GraphicOrderInteraction) { return $component->getHotspotChoices()->getArrayCopy(); } elseif ($component instanceof ModalFeedback) { return $component->getContent()->getArrayCopy(); } elseif ($component instanceof InfoControl) { return $component->getContent()->getArrayCopy(); } }