Skip to content

Commit

Permalink
Merge branch 'release-48.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed May 17, 2024
2 parents 441e3a7 + 651797d commit 4ee4617
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
14 changes: 9 additions & 5 deletions models/classes/class.QtiTestService.php
Original file line number Diff line number Diff line change
Expand Up @@ -801,11 +801,15 @@ protected function importTest(
// 4. Import metadata for the resource (use same mechanics as item resources).
// Metadata will be set as property values.
$this->getMetadataImporter()->inject($qtiTestResource->getIdentifier(), $testResource);
$this->getServiceManager()->getContainer()->get(MappedMetadataInjector::class)->inject(
$mappedProperties['testProperties'] ?? [],
$metadataValues[$qtiTestResourceIdentifier],
$testResource
);
//todo: fix taoSetup to be aware of containers. This is only workaround.
if ($this->getServiceManager()->getContainer()->has(MappedMetadataInjector::class)) {
$this->getServiceManager()->getContainer()->get(MappedMetadataInjector::class)->inject(
$mappedProperties['testProperties'] ?? [],
$metadataValues[$qtiTestResourceIdentifier],
$testResource
);
}


// 5. if $targetClass does not contain any instances
// (because everything resolved by class lookups),
Expand Down
4 changes: 2 additions & 2 deletions models/classes/import/class.TestImportForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ private function addMetadataImportElement()
{
if (!$this->isMetadataDisabled()) {
$metadataImport = tao_helpers_form_FormFactory::getElement(self::METADATA_FORM_ELEMENT_NAME, 'Checkbox');
$metadataImport->setOptions([self::METADATA_FORM_ELEMENT_NAME => __('Import metadata or fail')]);
$metadataImport->setDescription(__('Metadata import'));
$metadataImport->setOptions([self::METADATA_FORM_ELEMENT_NAME => __('QTI metadata as properties')]);
$metadataImport->setDescription(__('Import'));
$metadataImport->setLevel(1);
$this->form->addElement($metadataImport);
$this->form->addToGroup('file', self::METADATA_FORM_ELEMENT_NAME);
Expand Down
Loading

0 comments on commit 4ee4617

Please sign in to comment.