Skip to content

Commit

Permalink
fix: handle import of props without metadata
Browse files Browse the repository at this point in the history
(cherry picked from commit 0984101)
  • Loading branch information
Karol-Stelmaczonek committed Dec 10, 2024
1 parent 3d2fb16 commit 85bc7e0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion models/classes/class.QtiTestService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 [];
Expand Down

0 comments on commit 85bc7e0

Please sign in to comment.