Exemplo n.º 1
0
 private function buildItemBodySimple(array $interactions)
 {
     $interactions = array_values($interactions);
     $contentCollection = new QtiComponentCollection();
     // Append the extra contents belong to an interaction before the interaction itself
     foreach ($interactions as $data) {
         if (isset($data['extraContent'])) {
             $content = QtiMarshallerUtil::unmarshallElement($data['extraContent']);
             $contentCollection->merge($content);
         }
         $contentCollection->attach($data['interaction']);
     }
     $itemBody = new ItemBody();
     $itemBody->setContent(ContentCollectionBuilder::buildBlockCollectionContent($contentCollection));
     return $itemBody;
 }