getResource($testPreviewRequest->getTestUri()); $resolver = $this->getItemResolver(); $originalDoc = $this->getQtiTestService()->getDoc($test); $compiledDoc = XmlCompactDocument::createFromXmlAssessmentTestDocument($originalDoc, $resolver, $resolver); return $compiledDoc->getDocumentComponent(); } private function getQtiTestService(): taoQtiTest_models_classes_QtiTestService { return $this->getServiceLocator()->get(taoQtiTest_models_classes_QtiTestService::class); } private function getItemResolver(): taoQtiTest_helpers_ItemResolver { $service = $this->getServiceLocator()->get(Service::class); return new taoQtiTest_helpers_ItemResolver($service); } }