本文整理汇总了PHP中qtism\data\QtiComponent::getContent方法的典型用法代码示例。如果您正苦于以下问题:PHP QtiComponent::getContent方法的具体用法?PHP QtiComponent::getContent怎么用?PHP QtiComponent::getContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qtism\data\QtiComponent
的用法示例。
在下文中一共展示了QtiComponent::getContent方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: marshall
/**
* Marshall a RubricBlock object into a DOMElement object.
*
* @param QtiComponent $component A RubricBlock object.
* @return DOMElement The according DOMElement object.
*/
protected function marshall(QtiComponent $component)
{
$element = static::getDOMCradle()->createElement($component->getQtiClassName());
$arrayViews = array();
foreach ($component->getViews() as $view) {
$key = array_search($view, View::asArray());
// replace '_' by the space char.
$arrayViews[] = strtolower(str_replace("ò", " ", $key));
}
if (count($arrayViews) > 0) {
static::setDOMElementAttribute($element, 'view', implode(" ", $arrayViews));
}
if ($component->getUse() != '') {
static::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));
}
self::fillElement($element, $component);
return $element;
}
示例2: marshall
/**
* Marshall a Tbody/Thead/Tfoot object into a DOMElement object.
*
* @param QtiComponent $component A TBody/Thead/Tfoot object.
* @return DOMElement The according DOMElement object.
* @throws MarshallingException
*/
protected function marshall(QtiComponent $component)
{
$element = self::getDOMCradle()->createElement($component->getQtiClassName());
foreach ($component->getContent() as $tr) {
$marshaller = $this->getMarshallerFactory()->createMarshaller($tr);
$element->appendChild($marshaller->marshall($tr));
}
self::fillElement($element, $component);
return $element;
}
示例3: marshall
/**
* Marshall a Colgroup object into a DOMElement object.
*
* @param QtiComponent $component A Colgroup object.
* @return DOMElement The according DOMElement object.
* @throws MarshallingException
*/
protected function marshall(QtiComponent $component)
{
$element = self::getDOMCradle()->createElement('colgroup');
self::setDOMElementAttribute($element, 'span', $component->getSpan());
foreach ($component->getContent() as $col) {
$marshaller = $this->getMarshallerFactory()->createMarshaller($col);
$element->appendChild($marshaller->marshall());
}
self::fillElement($element, $component);
return $element;
}
示例4: marshall
/**
* Marshall a TestFeedback object into a DOMElement object.
*
* @param QtiComponent $component A TestFeedback object.
* @return DOMElement The according DOMElement object.
*/
protected function marshall(QtiComponent $component)
{
$element = static::getDOMCradle()->createElement($component->getQtiClassName());
$access = $component->getAccess() == TestFeedbackAccess::AT_END ? 'atEnd' : 'during';
$showHide = $component->getShowHide() == ShowHide::SHOW ? 'show' : 'hide';
self::setDOMElementAttribute($element, 'access', $access);
self::setDOMElementAttribute($element, 'outcomeIdentifier', $component->getOutcomeIdentifier());
self::setDOMElementAttribute($element, 'showHide', $showHide);
self::setDOMElementAttribute($element, 'identifier', $component->getIdentifier());
$title = $component->getTitle();
if (!empty($title)) {
self::setDOMElementAttribute($element, 'title', $title);
}
$flowStatic = static::getDOMCradle()->createDocumentFragment();
$flowStatic->appendXML($component->getContent());
$element->appendChild($flowStatic);
return $element;
}
示例5: marshallChildrenKnown
/**
* @see \qtism\data\storage\xml\marshalling\RecursiveMarshaller::marshallChildrenKnown()
*/
protected function marshallChildrenKnown(QtiComponent $component, array $elements)
{
$element = self::getDOMCradle()->createElement($component->getQtiClassName());
$headers = $component->getHeaders();
if (count($headers) > 0) {
self::setDOMElementAttribute($element, 'headers', implode(" ", $headers->getArrayCopy()));
}
if ($component->hasScope() === true) {
self::setDOMElementAttribute($element, 'scope', TableCellScope::getNameByConstant($component->getScope()));
}
if ($component->hasAbbr() === true) {
self::setDOMElementAttribute($element, 'abbr', $component->getAbbr());
}
if ($component->hasAxis() === true) {
self::setDOMElementAttribute($element, 'axis', $component->getAxis());
}
if ($component->hasRowspan() === true) {
self::setDOMElementAttribute($element, 'rowspan', $component->getRowspan());
}
if ($component->hasColspan() === true) {
self::setDOMElementAttribute($element, 'colspan', $component->getColspan());
}
foreach ($component->getContent() as $c) {
$marshaller = $this->getMarshallerFactory()->createMarshaller($c);
$element->appendChild($marshaller->marshall($c));
}
$this->fillElement($element, $component);
return $element;
}
示例6: appendElement
protected function appendElement(DOMDocumentFragment $fragment, QtiComponent $component, $base = '')
{
$fragment->appendChild($this->getRenderingEngine()->getDocument()->createTextNode($component->getContent()));
}
示例7: getChildrenComponents
/**
* @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();
}
}
示例8: marshall
/**
* Marshall a TextRun object into a DOMElement object.
*
* @param \qtism\data\QtiComponent $component A TextRun object.
* @return \DOMElement The according DOMElement object.
*/
protected function marshall(QtiComponent $component)
{
$element = static::getDOMCradle()->createTextNode($component->getContent());
return $element;
}