protected function buildPossibleResponseMapping(QtiGraphicGapMatchInteraction $interaction) { $possibleResponseMapping = []; $gapChoices = $interaction->getGapImgs(); /** @var GapChoice $gapChoice */ foreach ($gapChoices as $gapChoice) { $gapChoiceContent = QtiMarshallerUtil::marshallCollection($gapChoice->getComponents()); $possibleResponseMapping[$gapChoice->getIdentifier()] = $gapChoiceContent; } return $possibleResponseMapping; }