From 4ceb5fd01ca15275a4abf31405b16c2941118522 Mon Sep 17 00:00:00 2001 From: Wojtek Date: Sat, 17 Oct 2026 13:09:37 +0200 Subject: [PATCH] Print current comments and AI feedback --- README.md | 2 +- .../sql/updates/mysql/1.43.37.sql | 1 + .../com_testquestions/tmpl/result/default.php | 24 +++++++++++++++---- com_testquestions.xml | 2 +- 4 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 administrator/components/com_testquestions/sql/updates/mysql/1.43.37.sql diff --git a/README.md b/README.md index 8a51f71..7ef7bf2 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,6 @@ Szkielet komponentu Joomla 6 do gromadzenia pytań testowych. ## Instalacja -W Joomla wybierz **System → Install → Install from Folder** i wskaż ten katalog. Manifestem instalacyjnym jest `com_testquestions.xml` (wersja 1.43.36). +W Joomla wybierz **System → Install → Install from Folder** i wskaż ten katalog. Manifestem instalacyjnym jest `com_testquestions.xml` (wersja 1.43.37). Po instalacji komponent jest dostępny w panelu administratora jako **Pytania testowe**. diff --git a/administrator/components/com_testquestions/sql/updates/mysql/1.43.37.sql b/administrator/components/com_testquestions/sql/updates/mysql/1.43.37.sql new file mode 100644 index 0000000..3cd5311 --- /dev/null +++ b/administrator/components/com_testquestions/sql/updates/mysql/1.43.37.sql @@ -0,0 +1 @@ +-- Brak zmian w schemacie bazy danych w wersji 1.43.37. diff --git a/administrator/components/com_testquestions/tmpl/result/default.php b/administrator/components/com_testquestions/tmpl/result/default.php index a55e810..2c21c64 100644 --- a/administrator/components/com_testquestions/tmpl/result/default.php +++ b/administrator/components/com_testquestions/tmpl/result/default.php @@ -21,7 +21,7 @@ $resolveImageUrl = static function ($path) { @@ -42,6 +43,18 @@ $resolveImageUrl = static function ($path) { window.print(); }); }); + window.addEventListener('beforeprint', function () { + document.querySelectorAll('.result-pdf-comment').forEach(function (commentBlock) { + const questionId = commentBlock.dataset.questionId; + const manualComment = document.getElementById('result-comment-' + questionId)?.value.trim() || ''; + const aiComment = commentBlock.dataset.aiComment || ''; + const output = commentBlock.querySelector('.result-pdf-comment-text'); + + if (output) { + output.textContent = manualComment || aiComment || '—'; + } + }); + });
item->extra_time > 0 ? ' style="background-color: #fff3cd;"' : ''; ?>> @@ -129,8 +142,11 @@ $resolveImageUrl = static function ($path) {
:
- -
:
+ question_type === 'open') : ?> +
+ :
+ +
question_type === 'open' && $hasResponse) : ?> diff --git a/com_testquestions.xml b/com_testquestions.xml index 71c5ac6..e1d32ee 100644 --- a/com_testquestions.xml +++ b/com_testquestions.xml @@ -4,7 +4,7 @@ 2026-10-14 Komponent GNU General Public License version 2 or later - 1.43.36 + 1.43.37 COM_TESTQUESTIONS_DESCRIPTION com_testquestions Komponent\Component\Testquestions