當前位置: 首頁>>代碼示例>>PHP>>正文


PHP QtiComponent::getContent方法代碼示例

本文整理匯總了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;
 }
開發者ID:swapnilaptara,項目名稱:tao-aptara-assess,代碼行數:35,代碼來源:RubricBlockMarshaller.php

示例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;
 }
開發者ID:swapnilaptara,項目名稱:tao-aptara-assess,代碼行數:17,代碼來源:TablePartMarshaller.php

示例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;
 }
開發者ID:swapnilaptara,項目名稱:tao-aptara-assess,代碼行數:18,代碼來源:ColgroupMarshaller.php

示例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;
 }
開發者ID:swapnilaptara,項目名稱:tao-aptara-assess,代碼行數:24,代碼來源:TestFeedbackMarshaller.php

示例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;
 }
開發者ID:nagyist,項目名稱:qti-sdk,代碼行數:32,代碼來源:TableCellMarshaller.php

示例6: appendElement

 protected function appendElement(DOMDocumentFragment $fragment, QtiComponent $component, $base = '')
 {
     $fragment->appendChild($this->getRenderingEngine()->getDocument()->createTextNode($component->getContent()));
 }
開發者ID:swapnilaptara,項目名稱:tao-aptara-assess,代碼行數:4,代碼來源:TextRunRenderer.php

示例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();
     }
 }
開發者ID:nagyist,項目名稱:qti-sdk,代碼行數:83,代碼來源:ContentMarshaller.php

示例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;
 }
開發者ID:nagyist,項目名稱:qti-sdk,代碼行數:11,代碼來源:TextRunMarshaller.php


注:本文中的qtism\data\QtiComponent::getContent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。