diff --git a/models/classes/class.QtiTestService.php b/models/classes/class.QtiTestService.php index f51e98017..542d36701 100644 --- a/models/classes/class.QtiTestService.php +++ b/models/classes/class.QtiTestService.php @@ -1545,8 +1545,19 @@ private function getMappedProperties( if ($importMetadata === true) { $metaMetadataValues = $this->getMetaMetadataExtractor()->extract($domManifest); $reportCtx->metaMetadata = $metaMetadataValues; - return $this->getMetaMetadataImporter() + + $mappedMetadataValues = $this->getMetaMetadataImporter() ->mapMetaMetadataToProperties($metaMetadataValues, $targetItemClass, $testClass); + + if (empty($mappedMetadataValues)) { + $metadataValues = $this->getMetadataImporter()->extract($domManifest); + $mappedMetadataValues = $this->getMetaMetadataImporter()->mapMetadataToProperties( + $metadataValues, + $targetItemClass, + $testClass + ); + } + return $mappedMetadataValues; } return [];