From fee3b20b2fcad0cbbbae46a3d2de754d97d51f84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Marsza=C5=82?= Date: Thu, 30 May 2024 13:57:09 +0200 Subject: [PATCH 1/3] fix: disable metadata export for APIP --- model/Export/QTIPackedItemExporter.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/model/Export/QTIPackedItemExporter.php b/model/Export/QTIPackedItemExporter.php index 42ed6278cf..132dc7b822 100755 --- a/model/Export/QTIPackedItemExporter.php +++ b/model/Export/QTIPackedItemExporter.php @@ -199,11 +199,14 @@ public function exportManifest($options = [], $exportResult = []) } $manifest = $this->getManifest(); - $this->getMetadataExporter()->export($this->getItem(), $manifest); - $this->injectMetadataToManifest($manifest, $this->getItem()); - $this->setManifest($manifest); + //APIP does not support metadata at this moment + if(!isset($options['apip']) && $options['apip'] !== true){ + $this->getMetadataExporter()->export($this->getItem(), $manifest); + $this->injectMetadataToManifest($manifest, $this->getItem()); + } + $this->setManifest($manifest); // -- Overwrite manifest in the current ZIP archive. $zipArchive->addFromString('imsmanifest.xml', $this->getManifest()->saveXML()); } else { From 0a279b70efc8c9785863876a518fb6b2040c4232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Marsza=C5=82?= Date: Fri, 31 May 2024 14:18:32 +0200 Subject: [PATCH 2/3] fix: if statement improvement --- model/Export/QTIPackedItemExporter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/Export/QTIPackedItemExporter.php b/model/Export/QTIPackedItemExporter.php index 132dc7b822..0c5083e1a3 100755 --- a/model/Export/QTIPackedItemExporter.php +++ b/model/Export/QTIPackedItemExporter.php @@ -201,7 +201,7 @@ public function exportManifest($options = [], $exportResult = []) $manifest = $this->getManifest(); //APIP does not support metadata at this moment - if(!isset($options['apip']) && $options['apip'] !== true){ + if(!isset($options['apip']) || (isset($options['apip']) && $options['apip'] !== true)){ $this->getMetadataExporter()->export($this->getItem(), $manifest); $this->injectMetadataToManifest($manifest, $this->getItem()); } From 4d450d482d2a5c16354b321b57b349192e7f1525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Marsza=C5=82?= Date: Fri, 31 May 2024 14:28:41 +0200 Subject: [PATCH 3/3] fix: if statement improvement --- model/Export/QTIPackedItemExporter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/Export/QTIPackedItemExporter.php b/model/Export/QTIPackedItemExporter.php index 0c5083e1a3..d64c90a4e0 100755 --- a/model/Export/QTIPackedItemExporter.php +++ b/model/Export/QTIPackedItemExporter.php @@ -201,7 +201,7 @@ public function exportManifest($options = [], $exportResult = []) $manifest = $this->getManifest(); //APIP does not support metadata at this moment - if(!isset($options['apip']) || (isset($options['apip']) && $options['apip'] !== true)){ + if (!isset($options['apip']) || (isset($options['apip']) && $options['apip'] !== true)) { $this->getMetadataExporter()->export($this->getItem(), $manifest); $this->injectMetadataToManifest($manifest, $this->getItem()); }