public static function buildQtiImageObject($data, $type) { $object = new Object($data, $type); $objectFlowCollection = new ObjectFlowCollection(); $objectFlowCollection->attach(new TextRun('qwe')); $object->setContent($objectFlowCollection); return $object; }
public static function buildObjectFlowCollectionContent(QtiComponentCollection $content) { $collection = new ObjectFlowCollection(); foreach ($content as $component) { $collection->attach($component); } return $collection; }
private function buildMainImageObject(imageclozeassociation_image $image) { $imageSrc = $image->get_src(); list($imageWidth, $imageHeight) = CurlUtil::getImageSize(CurlUtil::prepareUrlForCurl($imageSrc)); $imageObject = new Object($imageSrc, MimeUtil::guessMimeType($imageSrc)); $imageObject->setWidth($imageWidth); $imageObject->setHeight($imageHeight); // Map `alt` to object content if (!is_null($image->get_alt())) { $objectFlowCollection = new ObjectFlowCollection(); $objectFlowCollection->attach(new TextRun($image->get_alt())); $imageObject->setContent($objectFlowCollection); } return $imageObject; }