getTestService()->getDoc($test)->saveToString(); } /** * {@inheritdoc} */ public function saveStringTest(core_kernel_classes_Resource $test, string $testString) : bool { $doc = new XmlDocument(); $doc->loadFromString($testString, true); $converter = new \taoQtiTest_models_classes_QtiTestConverter($doc); return $this->getTestService()->saveJsonTest($test, $converter->toJson()); } /** * {@inheritdoc} */ public function isLocked(): bool { return $this->hasOption('is_locked') ? (bool)$this->getOption('is_locked') : true; } private function getTestService() : taoQtiTest_models_classes_QtiTestService { return $this->getServiceLocator()->get(taoQtiTest_models_classes_QtiTestService::class); } }