Skip to content

Commit

Permalink
Merge branch 'release-47.1.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Jun 27, 2023
2 parents afc428f + 4adb7f9 commit c272c07
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions models/classes/xmlEditor/XmlEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@
namespace oat\taoQtiTest\models\xmlEditor;

use oat\oatbox\service\ConfigurableService;
use oat\tao\model\featureFlag\FeatureFlagChecker;
use qtism\data\storage\xml\XmlDocument;
use taoQtiTest_models_classes_QtiTestService;
use core_kernel_classes_Resource;

class XmlEditor extends ConfigurableService implements XmlEditorInterface
{
private const XML_EDITOR_ENABLED = 'XML_EDITOR_ENABLED';
/**
* {@inheritdoc}
*/
Expand All @@ -54,11 +56,20 @@ public function saveStringTest(core_kernel_classes_Resource $test, string $testS
*/
public function isLocked(): bool
{
if ($this->getFeatureFlagChecker()->isEnabled(self::XML_EDITOR_ENABLED)) {
return false;
}

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);
}

private function getFeatureFlagChecker(): FeatureFlagChecker
{
return $this->getServiceManager()->getContainer()->get(FeatureFlagChecker::class);
}
}

0 comments on commit c272c07

Please sign in to comment.