diff --git a/composer.json b/composer.json index 81d4dc8..364f481 100644 --- a/composer.json +++ b/composer.json @@ -70,6 +70,7 @@ "oat-sa/extension-tao-delivery": ">=15.0.0", "oat-sa/extension-tao-lti": ">=12.0.0", "oat-sa/extension-tao-outcomeui": ">=11.0.0", - "oat-sa/extension-tao-testqti-previewer": ">=3.0.0" + "oat-sa/extension-tao-testqti-previewer": ">=3.0.0", + "oat-sa/extension-tao-testqti" : ">=41.22.2" } } diff --git a/controller/ItemResultPreviewer.php b/controller/ItemResultPreviewer.php index 6457842..e594e9a 100755 --- a/controller/ItemResultPreviewer.php +++ b/controller/ItemResultPreviewer.php @@ -1,4 +1,5 @@ defaultData(); $data['type'] = $this->getItemResultPreviewerType($resultIdentifier); $data['content'] = $this->getItemContent($itemDefinition, $resultIdentifier, $delivery->getUri()); - $data['state'] = current($this->getItemResultVariables($delivery, $resultIdentifier, $itemDefinition) ?? []); + $data['state'] = current( + $this->getItemResultVariables($delivery, $resultIdentifier, $itemDefinition) ?? [] + ); $data['itemDefinition'] = $itemDefinition; $data['resultIdentifier'] = $resultIdentifier; $data['deliveryIdentifier'] = $delivery->getUri(); @@ -124,8 +127,10 @@ public function preview() */ protected function getItemResultPreviewerType($resultIdentifier) { - return $this->getServiceLocator()->get(ResultsViewerService::SERVICE_ID) - ->getDeliveryItemType($resultIdentifier); + /** @var DeliveryItemTypeRepository $deliveryItemTypeRepository */ + $deliveryItemTypeRepository = $this->getServiceLocator()->get(DeliveryItemTypeRepository::SERVICE_ID); + + return $deliveryItemTypeRepository->getDeliveryItemType($resultIdentifier); } /** @@ -230,7 +235,9 @@ protected function getItemVariable($delivery, $resultIdentifier, $itemDefinition { if (!isset($this->itemVariables[$itemDefinition])) { $variables = $this->getDeliveryResultsService($delivery)->getStructuredVariables( - $resultIdentifier, ResultsService::VARIABLES_FILTER_ALL, [\taoResultServer_models_classes_ResponseVariable::class] + $resultIdentifier, + ResultsService::VARIABLES_FILTER_ALL, + [\taoResultServer_models_classes_ResponseVariable::class] ); $itemVariables = [];