protected function buildTemplate(QtiGraphicGapMatchInteraction $interaction, Object $object) { $associableHotspots = []; foreach ($interaction->getAssociableHotspots() as $associableHotspot) { /** @var AssociableHotspot $associableHotspot */ $associableHotspots[$associableHotspot->getIdentifier()] = QtiCoordinateUtil::convertQtiCoordsToPercentage([$object->getWidth(), $object->getHeight()], explode(',', $associableHotspot->getCoords()), $associableHotspot->getShape()); } return $associableHotspots; }