public static function buildRectShapesChoices() { $collection = new HotspotChoiceCollection(); $collection->attach(new HotspotChoice('A', QtiShape::RECT, new QtiCoords(QtiShape::RECT, [7, 12, 64, 28]))); $collection->attach(new HotspotChoice('B', QtiShape::RECT, new QtiCoords(QtiShape::RECT, [66, 11, 125, 30]))); return $collection; }
public static function build($identifier, $bgObject, $hotspotChoices) { $hotSpotChoiceCollection = new HotspotChoiceCollection(); foreach ($hotspotChoices as $identifier => $data) { $coords = new QtiCoords(QtiShape::CIRCLE, $data); $hotspotChoice = new HotspotChoice($identifier, QtiShape::CIRCLE, $coords); $hotSpotChoiceCollection->attach($hotspotChoice); } return new GraphicOrderInteraction($identifier, $bgObject, $hotSpotChoiceCollection); }