Skip to content

Commit

Permalink
Merge pull request #189 from oat-sa/release-3.8.0
Browse files Browse the repository at this point in the history
Release 3.8.0
  • Loading branch information
pnal authored Apr 10, 2023
2 parents 65a6bf5 + 099de93 commit 0488d79
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 13 deletions.
20 changes: 20 additions & 0 deletions controller/TestPreviewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
use oat\taoQtiTestPreviewer\models\test\TestPreviewRequest;
use oat\taoQtiTestPreviewer\models\TestCategoryPresetMap;
use oat\taoQtiTestPreviewer\models\testConfiguration\service\TestPreviewerConfigurationService;
use qtism\data\storage\xml\XmlStorageException;
use tao_actions_ServiceModule;
use Throwable;

Expand Down Expand Up @@ -63,6 +64,9 @@ public function init()
'presetMap' => $this->getTestPreviewerPresetsMapService()->getMap()
]
);
} catch (XmlStorageException $xmlStorageException) {
$message = $this->mapXmlExceptionMessage($xmlStorageException);
$this->setErrorJsonResponse($message);
} catch (Throwable $exception) {
$message = $exception instanceof common_exception_UserReadableException
? $exception->getUserMessage()
Expand Down Expand Up @@ -111,4 +115,20 @@ private function getTestPreviewerPresetsMapService(): TestCategoryPresetMap
{
return $this->getPsrContainer()->get(TestCategoryPresetMap::class);
}

private function mapXmlExceptionMessage(XmlStorageException $exception): string
{
if (
stristr(
$exception->getMessage(),
'An error occurred while unreferencing item reference with identifier'
) !== false
) {
return __(
'It seems that some items have been deleted. ' .
'Please remove the items with empty labels from the test and save before trying again.'
);
}
return $exception->getMessage();
}
}
7 changes: 5 additions & 2 deletions locales/fr-FR/messages.po
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: TAO 2022.06\n"
"PO-Revision-Date: 2022-07-29T10:38:02\n"
"Project-Id-Version: TAO 2023.02 LTS\n"
"PO-Revision-Date: 2023-03-02T15:43:34\n"
"Last-Translator: TAO Translation Team <[email protected]>\n"
"MIME-Version: 1.0\n"
"Language: fr-FR\n"
Expand Down Expand Up @@ -40,6 +40,9 @@ msgstr ""
msgid "Go back to tests selection"
msgstr ""

msgid "It seems that some items have been deleted. Please remove the items with empty labels from the test and save before trying again."
msgstr ""

msgid "It seems that there is an error during item preview loading. Please, try again."
msgstr ""

Expand Down
4 changes: 2 additions & 2 deletions locales/fr-FR/previewerRole.rdf.po
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: TAO 2022.06\n"
"PO-Revision-Date: 2022-07-29T10:38:02\n"
"Project-Id-Version: TAO 2023.02 LTS\n"
"PO-Revision-Date: 2023-03-02T15:43:34\n"
"Last-Translator: TAO Translation Team <[email protected]>\n"
"MIME-Version: 1.0\n"
"Language: fr-FR\n"
Expand Down
7 changes: 5 additions & 2 deletions locales/ja-JP/messages.po
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: TAO 2022.09\n"
"PO-Revision-Date: 2022-08-12T16:45:57\n"
"Project-Id-Version: TAO 2023.02 LTS\n"
"PO-Revision-Date: 2023-03-02T15:43:34\n"
"Last-Translator: TAO Translation Team <[email protected]>\n"
"MIME-Version: 1.0\n"
"Language: ja-JP\n"
Expand Down Expand Up @@ -40,6 +40,9 @@ msgstr "ファイルが見つかりません"
msgid "Go back to tests selection"
msgstr "テスト一覧に戻る"

msgid "It seems that some items have been deleted. Please remove the items with empty labels from the test and save before trying again."
msgstr ""

msgid "It seems that there is an error during item preview loading. Please, try again."
msgstr "アイテムプレビューの読み込み中にエラーが発生したようです。お手数ですが、もう一度お試しください。"

Expand Down
4 changes: 2 additions & 2 deletions locales/ja-JP/previewerRole.rdf.po
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: TAO 2022.09\n"
"PO-Revision-Date: 2022-08-12T16:45:57\n"
"Project-Id-Version: TAO 2023.02 LTS\n"
"PO-Revision-Date: 2023-03-02T15:43:34\n"
"Last-Translator: TAO Translation Team <[email protected]>\n"
"MIME-Version: 1.0\n"
"Language: ja-JP\n"
Expand Down
4 changes: 3 additions & 1 deletion models/test/service/TestPreviewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
class TestPreviewer extends ConfigurableService implements TestPreviewerInterface
{
/**
* @inheritDoc
* @param TestPreviewRequest $testPreviewRequest
* @return TestPreview
* @throws \qtism\data\storage\xml\XmlStorageException
*/
public function createPreview(TestPreviewRequest $testPreviewRequest): TestPreview
{
Expand Down
2 changes: 1 addition & 1 deletion views/js/loader/qtiPreviewer.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion views/js/previewer/component/test/css/qtiTest.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion views/js/previewer/component/topBlock/css/topBlock.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0488d79

Please sign in to comment.