diff --git a/actions/TestTaker.php b/actions/TestTaker.php index 20122ac..90c43fd 100644 --- a/actions/TestTaker.php +++ b/actions/TestTaker.php @@ -29,6 +29,7 @@ use core_kernel_classes_Property; use core_kernel_classes_Resource; use core_kernel_users_Service; +use oat\oatbox\validator\ValidatorInterface; use oat\generis\Helper\UserHashForEncryption; use oat\generis\model\GenerisRdf; use oat\generis\model\OntologyAwareTrait; @@ -44,6 +45,7 @@ use tao_helpers_Uri; use tao_models_classes_UserService; use tao_helpers_form_FormContainer as FormContainer; +use oat\tao\model\Lists\Business\Validation\DependsOnPropertyValidator; /** * Subjects Controller provide actions performed from url resolution @@ -147,7 +149,14 @@ public function editSubject() $clazz, $subject, $addMode, - [FormContainer::CSRF_PROTECTION_OPTION => true] + [ + FormContainer::CSRF_PROTECTION_OPTION => true, + FormContainer::ATTRIBUTE_VALIDATORS => [ + 'data-depends-on-property' => [ + $this->getDependsOnPropertyValidator(), + ], + ], + ] ); $myForm = $myFormContainer->getForm(); @@ -270,4 +279,9 @@ public function moveClass() { return parent::moveResource(); } + + private function getDependsOnPropertyValidator(): ValidatorInterface + { + return $this->getPsrContainer()->get(DependsOnPropertyValidator::class); + } } diff --git a/composer.json b/composer.json index e0a3f5e..8cde89a 100644 --- a/composer.json +++ b/composer.json @@ -1,56 +1,64 @@ { - "support" : { - "forum" : "http://forum.taotesting.com", - "issues" : "http://forge.taotesting.com" - }, - "homepage" : "http://www.taotesting.com", - "license" : "GPL-2.0-only", - "keywords" : [ - "tao", - "oat", - "computer-based-assessment" - ], - "name" : "oat-sa/extension-tao-testtaker", - "description" : "extension to manage testtakers ", - "type" : "tao-extension", - "authors" : [{ - "name" : "Open Assessment Technologies S.A.", - "homepage" : "http://www.taotesting.com" - }, { - "name" : "Jérôme Bogaerts", - "role" : "Developer" - }, { - "name" : "Joel Bout", - "role" : "Developer" - }, { - "name" : "Bertrand Chevrier", - "role" : "Developer" - }, { - "name" : "Lionel Lecaque", - "role" : "Developer" - }, { - "name" : "Patrick Plichart", - "role" : "Developer" - }, { - "name" : "Dieter Raber", - "role" : "Developer" - }, { - "name" : "Somsack Sipasseuth", - "role" : "Developer" - } - ], - "extra" : { - "tao-extension-name" : "taoTestTaker" - }, - "autoload" : { - "psr-4" : { - "oat\\taoTestTaker\\" : "" - } - }, - "require" : { - "oat-sa/oatbox-extension-installer" : "~1.1||dev-master", - "oat-sa/tao-core" : ">=47.0.0", - "oat-sa/generis" : ">=14.0.0", - "oat-sa/extension-tao-backoffice" : ">=6.0.0" - } -} \ No newline at end of file + "support": { + "forum": "http://forum.taotesting.com", + "issues": "http://forge.taotesting.com" + }, + "homepage": "http://www.taotesting.com", + "license": "GPL-2.0-only", + "keywords": [ + "tao", + "oat", + "computer-based-assessment" + ], + "name": "oat-sa/extension-tao-testtaker", + "description": "extension to manage testtakers ", + "type": "tao-extension", + "authors": [ + { + "name": "Open Assessment Technologies S.A.", + "homepage": "http://www.taotesting.com" + }, + { + "name": "Jérôme Bogaerts", + "role": "Developer" + }, + { + "name": "Joel Bout", + "role": "Developer" + }, + { + "name": "Bertrand Chevrier", + "role": "Developer" + }, + { + "name": "Lionel Lecaque", + "role": "Developer" + }, + { + "name": "Patrick Plichart", + "role": "Developer" + }, + { + "name": "Dieter Raber", + "role": "Developer" + }, + { + "name": "Somsack Sipasseuth", + "role": "Developer" + } + ], + "extra": { + "tao-extension-name": "taoTestTaker" + }, + "autoload": { + "psr-4": { + "oat\\taoTestTaker\\": "" + } + }, + "require": { + "oat-sa/oatbox-extension-installer": "~1.1||dev-master", + "oat-sa/tao-core": ">=48.45.0", + "oat-sa/generis": ">=14.0.0", + "oat-sa/extension-tao-backoffice": ">=6.0.0" + } +}