Skip to content

Commit

Permalink
Merge pull request #2573 from oat-sa/fix/AUT-3833/backport-import-met…
Browse files Browse the repository at this point in the history
…adata-fix

Backport fix/AUT-3833/backport-import-metadata-fix
  • Loading branch information
bartlomiejmarszal authored Sep 12, 2024
2 parents c04cdbd + dda4e1a commit 4814038
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions model/qti/ImportService.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,14 @@ public function importQTIPACKFile(
/** @var Resource[] $qtiItemResources */
$qtiItemResources = $this->createQtiManifest($folder . 'imsmanifest.xml');

$metadataValues = $this->getMetadataImporter()->extract($domManifest);
$metaMetadataValues = $this->getMetaMetadataExtractor()->extract($domManifest);
$mappedMetadataValues = $this->getMetaMetadataImportMapper()->mapMetaMetadataToProperties(
$metaMetadataValues,
$itemClass
);
if ($importMetadataEnabled) {
$metadataValues = $this->getMetadataImporter()->extract($domManifest);
$metaMetadataValues = $this->getMetaMetadataExtractor()->extract($domManifest);
$mappedMetadataValues = $this->getMetaMetadataImportMapper()->mapMetaMetadataToProperties(
$metaMetadataValues,
$itemClass
);
}

$sharedFiles = [];
$createdClasses = [];
Expand All @@ -347,14 +349,14 @@ public function importQTIPACKFile(
$itemClass,
$sharedFiles,
[],
$metadataValues,
$metadataValues ?? [],
$createdClasses,
$enableMetadataGuardians,
$enableMetadataValidators,
$itemMustExist,
$itemMustBeOverwritten,
$overwrittenItems,
$mappedMetadataValues['itemProperties'],
isset($mappedMetadataValues['itemProperties']) ? $mappedMetadataValues['itemProperties'] : [],
$importMetadataEnabled
);

Expand Down

0 comments on commit 4814038

Please sign in to comment.