diff --git a/locales/da-DK/messages.po b/locales/da-DK/messages.po index a6d9473fa..5465f9268 100644 --- a/locales/da-DK/messages.po +++ b/locales/da-DK/messages.po @@ -1460,7 +1460,6 @@ msgid "The submission mode determines when the candidate's responses are submitt msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" -"" msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" diff --git a/locales/el-GR/messages.po b/locales/el-GR/messages.po index dd03af6e0..303822a01 100644 --- a/locales/el-GR/messages.po +++ b/locales/el-GR/messages.po @@ -1457,7 +1457,6 @@ msgid "The submission mode determines when the candidate's responses are submitt msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" -"" msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" diff --git a/locales/en-US/messages.po b/locales/en-US/messages.po index 194a867b8..8558d60ad 100644 --- a/locales/en-US/messages.po +++ b/locales/en-US/messages.po @@ -1460,7 +1460,6 @@ msgid "The submission mode determines when the candidate's responses are submitt msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" -"" msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" @@ -1768,3 +1767,8 @@ msgstr "" msgid "Zoom out" msgstr "" +msgid "Enforce Item Constraints" +msgstr "" + +msgid "Checking this box prevents the test-taker from navigating to other items until the current item constraints, if any, are met. Unchecking this box will allow free navigation even if the responses don't comply with the item constraints set." +msgstr "" diff --git a/locales/es-MX/messages.po b/locales/es-MX/messages.po index eb36d1561..7024c68ce 100644 --- a/locales/es-MX/messages.po +++ b/locales/es-MX/messages.po @@ -1456,7 +1456,6 @@ msgid "The submission mode determines when the candidate's responses are submitt msgstr "El modo de presentación determina cuando las respuestas de los candidatos se presentan para el procesamiento de la respuesta. Un testPart en modo individual requiere que el candidato presente sus respuestas en una base elemento por elemento. En el modo simultáneo las respuestas de los candidatos están presentadas juntas al final del testPart." msgid "The test cannot be saved because it currently contains invalid settings.\n" -"" msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" diff --git a/locales/fi-FI/messages.po b/locales/fi-FI/messages.po index 44b29b269..256a10933 100644 --- a/locales/fi-FI/messages.po +++ b/locales/fi-FI/messages.po @@ -1460,7 +1460,6 @@ msgid "The submission mode determines when the candidate's responses are submitt msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" -"" msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" diff --git a/locales/fr-CA/messages.po b/locales/fr-CA/messages.po index 0a0e79c7c..1d0203f29 100644 --- a/locales/fr-CA/messages.po +++ b/locales/fr-CA/messages.po @@ -1457,7 +1457,6 @@ msgid "The submission mode determines when the candidate's responses are submitt msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" -"" msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" diff --git a/locales/hu-HU/messages.po b/locales/hu-HU/messages.po index 9998e1c74..d2998a2b2 100644 --- a/locales/hu-HU/messages.po +++ b/locales/hu-HU/messages.po @@ -1457,7 +1457,6 @@ msgid "The submission mode determines when the candidate's responses are submitt msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" -"" msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" diff --git a/locales/id-ID/messages.po b/locales/id-ID/messages.po index 200915f95..880115ffa 100644 --- a/locales/id-ID/messages.po +++ b/locales/id-ID/messages.po @@ -1457,7 +1457,6 @@ msgid "The submission mode determines when the candidate's responses are submitt msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" -"" msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" diff --git a/locales/is-IS/messages.po b/locales/is-IS/messages.po index 98564322e..8b14d71fb 100644 --- a/locales/is-IS/messages.po +++ b/locales/is-IS/messages.po @@ -1457,7 +1457,6 @@ msgid "The submission mode determines when the candidate's responses are submitt msgstr "Skilahamurinn ákvarðar hvenær svör próftaka eru send til að meta svörin. Prófhluti í stykkjaham krefst þess að próftaki sendi svör sín hvert fyrir sig. Í fjölham eru svör próftaka öll send saman í lok prófhlutans." msgid "The test cannot be saved because it currently contains invalid settings.\n" -"" msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" diff --git a/locales/lb-LU/messages.po b/locales/lb-LU/messages.po index 81489a83c..6e584ea8f 100644 --- a/locales/lb-LU/messages.po +++ b/locales/lb-LU/messages.po @@ -1457,7 +1457,6 @@ msgid "The submission mode determines when the candidate's responses are submitt msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" -"" msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" diff --git a/locales/pl-PL/messages.po b/locales/pl-PL/messages.po index 030eece97..9663f5c52 100644 --- a/locales/pl-PL/messages.po +++ b/locales/pl-PL/messages.po @@ -1457,7 +1457,6 @@ msgid "The submission mode determines when the candidate's responses are submitt msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" -"" msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" diff --git a/locales/ru-RU/messages.po b/locales/ru-RU/messages.po index fecb67e4a..5d50486c2 100644 --- a/locales/ru-RU/messages.po +++ b/locales/ru-RU/messages.po @@ -1454,7 +1454,6 @@ msgid "The submission mode determines when the candidate's responses are submitt msgstr "В режиме отправки определяется, когда ответы кандидата отправляются на обработку. В индивидуальном режиме части теста от кандидата требуется отправлять свои ответы по одному элементу за раз. В одновременном режиме ответы кандидата отправляются все вместе по окончании части теста." msgid "The test cannot be saved because it currently contains invalid settings.\n" -"" msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" diff --git a/locales/sk-SK/messages.po b/locales/sk-SK/messages.po index 3e9912527..817296308 100644 --- a/locales/sk-SK/messages.po +++ b/locales/sk-SK/messages.po @@ -1457,7 +1457,6 @@ msgid "The submission mode determines when the candidate's responses are submitt msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" -"" msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" diff --git a/locales/sv-SE/messages.po b/locales/sv-SE/messages.po index 9aa0e3570..6d5ebdbb2 100644 --- a/locales/sv-SE/messages.po +++ b/locales/sv-SE/messages.po @@ -1457,7 +1457,6 @@ msgid "The submission mode determines when the candidate's responses are submitt msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" -"" msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" diff --git a/locales/uk-UA/messages.po b/locales/uk-UA/messages.po index f97378062..409161e7e 100644 --- a/locales/uk-UA/messages.po +++ b/locales/uk-UA/messages.po @@ -1457,7 +1457,6 @@ msgid "The submission mode determines when the candidate's responses are submitt msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" -"" msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" diff --git a/locales/zh-CN/messages.po b/locales/zh-CN/messages.po index 636691f41..f59e9dfec 100644 --- a/locales/zh-CN/messages.po +++ b/locales/zh-CN/messages.po @@ -1457,7 +1457,6 @@ msgid "The submission mode determines when the candidate's responses are submitt msgstr "考试提交模式决定考生回应什么时候被送回服务器处理。 在个别(individual)模式 ​​中,考生需要各自提交每一个题目,每个回应都会各自被送回服务器处理。 在同时(simultaneous)模式 ​​中,考生只需要考试没提交一次,所有的回应是同时在考试没被送回。" msgid "The test cannot be saved because it currently contains invalid settings.\n" -"" msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" diff --git a/locales/zh-SG/messages.po b/locales/zh-SG/messages.po index e98cbe9b6..cfabc4f58 100644 --- a/locales/zh-SG/messages.po +++ b/locales/zh-SG/messages.po @@ -1457,7 +1457,6 @@ msgid "The submission mode determines when the candidate's responses are submitt msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" -"" msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" diff --git a/locales/zh-TW/messages.po b/locales/zh-TW/messages.po index 9611d42da..f6ac4743d 100644 --- a/locales/zh-TW/messages.po +++ b/locales/zh-TW/messages.po @@ -1457,7 +1457,6 @@ msgid "The submission mode determines when the candidate's responses are submitt msgstr "考試提交模式決定考生回應什麼時候被送回服務器處理。在個別(individual)模式中,考生需要各自提交每一個題目,每個回應都會各自被送回服務器處理。在同時(simultaneous)模式中,考生只需要考試沒提交一次,所有的回應是同時在考試沒被送回。" msgid "The test cannot be saved because it currently contains invalid settings.\n" -"" msgstr "" msgid "The test cannot be saved because it currently contains invalid settings.\n" diff --git a/models/classes/Qti/ServiceProvider/QtiServiceProvider.php b/models/classes/Qti/ServiceProvider/QtiServiceProvider.php index 38963a388..88d07fa79 100644 --- a/models/classes/Qti/ServiceProvider/QtiServiceProvider.php +++ b/models/classes/Qti/ServiceProvider/QtiServiceProvider.php @@ -31,6 +31,7 @@ use oat\taoQtiTest\models\Qti\Identifier\Service\QtiIdentifierSetter; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; use taoQtiTest_models_classes_QtiTestService; + use function Symfony\Component\DependencyInjection\Loader\Configurator\service; class QtiServiceProvider implements ContainerServiceProviderInterface diff --git a/models/classes/class.QtiTestService.php b/models/classes/class.QtiTestService.php index 138910c4e..3b08d43de 100644 --- a/models/classes/class.QtiTestService.php +++ b/models/classes/class.QtiTestService.php @@ -360,14 +360,13 @@ private function generateIdentifier(XmlDocument $doc, $qtiType, $offset = 1) */ public function importMultipleTests( core_kernel_classes_Class $targetClass, - $file, - bool $overwriteTest = false, - ?string $itemClassUri = null, - array $form = [], - ?string $overwriteTestUri = null, - ?string $packageLabel = null - ) - { + $file, + bool $overwriteTest = false, + ?string $itemClassUri = null, + array $form = [], + ?string $overwriteTestUri = null, + ?string $packageLabel = null + ) { $testClass = $targetClass; $report = new Report(Report::TYPE_INFO); $validPackage = false; @@ -469,10 +468,10 @@ public function importMultipleTests( if ($report->containsError() === true) { $report->setMessage(__('The IMS QTI Test Package could not be imported.')); - $report->setType(common_report_Report::TYPE_ERROR); + $report->setType(Report::TYPE_ERROR); } else { $report->setMessage(__('IMS QTI Test Package successfully imported.')); - $report->setType(common_report_Report::TYPE_SUCCESS); + $report->setType(Report::TYPE_SUCCESS); } if ( @@ -557,18 +556,17 @@ public function clearRelatedResources(common_report_Report $report): void * @return common_report_Report A report about how the importation behaved. */ protected function importTest( - core_kernel_classes_Class $testClass, - Resource $qtiTestResource, + core_kernel_classes_Class $testClass, + Resource $qtiTestResource, taoQtiTest_models_classes_ManifestParser $manifestParser, - $folder, - array $ignoreQtiResources = [], - bool $overwriteTest = false, - ?string $itemClassUri = null, - bool $importMetadata = false, - ?string $overwriteTestUri = null, - ?string $packageLabel = null - ) - { + $folder, + array $ignoreQtiResources = [], + bool $overwriteTest = false, + ?string $itemClassUri = null, + bool $importMetadata = false, + ?string $overwriteTestUri = null, + ?string $packageLabel = null + ) { /** @var ImportService $itemImportService */ $itemImportService = $this->getServiceLocator()->get(ImportService::SERVICE_ID); $qtiTestResourceIdentifier = $qtiTestResource->getIdentifier(); @@ -595,6 +593,7 @@ protected function importTest( // Load and validate the manifest $qtiManifestParser = new taoQtiTest_models_classes_ManifestParser($folder . 'imsmanifest.xml'); $this->propagate($qtiManifestParser); + $qtiManifestParser->validate(); $domManifest = new DOMDocument('1.0', 'UTF-8'); $domManifest->load($folder . 'imsmanifest.xml'); @@ -767,9 +766,9 @@ protected function importTest( } else { if (!$itemReport->getMessage()) { $itemReport->setMessage( - // phpcs:disable Generic.Files.LineLength + // phpcs:disable Generic.Files.LineLength __('IMS QTI Item referenced as "%s" in the IMS Manifest file could not be imported.', $resourceIdentifier) - // phpcs:enable Generic.Files.LineLength + // phpcs:enable Generic.Files.LineLength ); } @@ -791,7 +790,7 @@ protected function importTest( common_report_Report::TYPE_SUCCESS, // phpcs:disable Generic.Files.LineLength __('IMS QTI Item referenced as "%s" in the IMS Manifest file successfully imported.', $resourceIdentifier) - // phpcs:enable Generic.Files.LineLength + // phpcs:enable Generic.Files.LineLength ) ); } @@ -912,7 +911,7 @@ protected function importTest( common_report_Report::TYPE_ERROR, // phpcs:disable Generic.Files.LineLength __("Items with assessmentItemRef identifiers \"%s\" are not registered in the related CAT endpoint.", implode(', ', $e->getInvalidItemIdentifiers())) - // phpcs:enable Generic.Files.LineLength + // phpcs:enable Generic.Files.LineLength ) ); } @@ -981,13 +980,12 @@ private function deleteTestsFromClassByLabel(string $testLabel, core_kernel_clas */ protected function importTestDefinition( core_kernel_classes_Resource $testResource, - XmlDocument $testDefinition, - Resource $qtiResource, - array $itemMapping, - $extractionFolder, - common_report_Report $report - ) - { + XmlDocument $testDefinition, + Resource $qtiResource, + array $itemMapping, + $extractionFolder, + common_report_Report $report + ) { foreach ($itemMapping as $itemRefId => $itemResource) { $itemRef = $testDefinition->getDocumentComponent()->getComponentByIdentifier($itemRefId); @@ -1045,12 +1043,11 @@ protected function getQtiDefinitionPath(Directory $dir) * @param common_report_Report A report about how the importation behaved. */ protected function importTestAuxiliaryFiles( - Directory $testContent, - Resource $qtiResource, - $extractionFolder, + Directory $testContent, + Resource $qtiResource, + $extractionFolder, common_report_Report $report - ) - { + ) { foreach ($qtiResource->getAuxiliaryFiles() as $aux) { try { @@ -1110,8 +1107,8 @@ public function getDoc(core_kernel_classes_Resource $test) * Get the path of the QTI XML test definition of a given $test resource. * * @param core_kernel_classes_Resource $test - * @return string The absolute path to the QTI XML Test definition related to $test. * @throws Exception If no QTI-XML or multiple QTI-XML test definition were found. + * @return string The absolute path to the QTI XML Test definition related to $test. */ public function getDocPath(core_kernel_classes_Resource $test) { @@ -1247,8 +1244,8 @@ protected function searchInTestDirectory(Directory $dir) * If it doesn't exist, it will be created * * @param core_kernel_classes_Resource $test - * @return File * @throws \Exception If file is not found. + * @return File */ public function getQtiTestFile(core_kernel_classes_Resource $test) { @@ -1266,8 +1263,8 @@ public function getQtiTestFile(core_kernel_classes_Resource $test) /** * * @param core_kernel_classes_Resource $test - * @return string * @throws Exception + * @return string */ public function getRelTestPath(core_kernel_classes_Resource $test) { @@ -1430,11 +1427,11 @@ public function getQtiTestAcceptableLatency() /** * - * @return string|boolean The QTI Test template file content or false if it could not be read. * @deprecated * * Get the content of the QTI Test template file as an XML string. * + * @return string|boolean The QTI Test template file content or false if it could not be read. */ public function getQtiTestTemplateFileAsString() { @@ -1547,13 +1544,12 @@ private function getMetaMetadataImporter(): MetaMetadataImportMapper } private function getMappedProperties( - bool $importMetadata, - DOMDocument $domManifest, - stdClass $reportCtx, + bool $importMetadata, + DOMDocument $domManifest, + stdClass $reportCtx, core_kernel_classes_Class $testClass, core_kernel_classes_Class $targetItemClass - ): array - { + ): array { if ($importMetadata === true) { $metaMetadataValues = $this->getMetaMetadataExtractor()->extract($domManifest); $reportCtx->metaMetadata = $metaMetadataValues; diff --git a/models/classes/render/QTI3PackagePreprocessing.php b/models/classes/render/QTI3PackagePreprocessing.php deleted file mode 100644 index eda114cdb..000000000 --- a/models/classes/render/QTI3PackagePreprocessing.php +++ /dev/null @@ -1,51 +0,0 @@ -read(); - $this->getZip()->open(); - $content = str_replace( - 'http://www.imsglobal.org/xsd/imsqtiasi_v3p0', - 'http://www.imsglobal.org/xsd/imscp_v1p1', - $content - ); - - $file->write($content); - - return new Report(Report::TYPE_INFO, 'QTI3 package preprocessing done'); - } - - private function getZip(): ZipArchive - { - return new ZipArchive(); - } -} diff --git a/views/js/controller/creator/templates/itemref-props.tpl b/views/js/controller/creator/templates/itemref-props.tpl index 24d490642..e82f9f32c 100644 --- a/views/js/controller/creator/templates/itemref-props.tpl +++ b/views/js/controller/creator/templates/itemref-props.tpl @@ -135,10 +135,10 @@
-
+
-
+
-
+
-
+