Skip to content

Commit

Permalink
feat: merge develop
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomiejmarszal committed Dec 20, 2024
2 parents 954a752 + 7074574 commit e4322e9
Show file tree
Hide file tree
Showing 26 changed files with 98 additions and 165 deletions.
1 change: 0 additions & 1 deletion locales/da-DK/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion locales/el-GR/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 5 additions & 1 deletion locales/en-US/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 ""
1 change: 0 additions & 1 deletion locales/es-MX/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion locales/fi-FI/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion locales/fr-CA/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion locales/hu-HU/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion locales/id-ID/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion locales/is-IS/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion locales/lb-LU/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion locales/pl-PL/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion locales/ru-RU/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion locales/sk-SK/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion locales/sv-SE/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion locales/uk-UA/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion locales/zh-CN/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion locales/zh-SG/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion locales/zh-TW/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions models/classes/Qti/ServiceProvider/QtiServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
88 changes: 42 additions & 46 deletions models/classes/class.QtiTestService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 (
Expand Down Expand Up @@ -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();
Expand All @@ -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');
Expand Down Expand Up @@ -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
);
}

Expand All @@ -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
)
);
}
Expand Down Expand Up @@ -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
)
);
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand Down Expand Up @@ -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()
{
Expand Down Expand Up @@ -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;
Expand Down
Loading

0 comments on commit e4322e9

Please sign in to comment.