Embed AI fallback in PDF comment block
This commit is contained in:
@@ -30,6 +30,6 @@ Szkielet komponentu Joomla 6 do gromadzenia pytań testowych.
|
|||||||
|
|
||||||
## Instalacja
|
## Instalacja
|
||||||
|
|
||||||
W Joomla wybierz **System → Install → Install from Folder** i wskaż ten katalog. Manifestem instalacyjnym jest `com_testquestions.xml` (wersja 1.43.38).
|
W Joomla wybierz **System → Install → Install from Folder** i wskaż ten katalog. Manifestem instalacyjnym jest `com_testquestions.xml` (wersja 1.43.39).
|
||||||
|
|
||||||
Po instalacji komponent jest dostępny w panelu administratora jako **Pytania testowe**.
|
Po instalacji komponent jest dostępny w panelu administratora jako **Pytania testowe**.
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
-- Brak zmian w schemacie bazy danych w wersji 1.43.39.
|
||||||
@@ -47,8 +47,9 @@ $resolveImageUrl = static function ($path) {
|
|||||||
document.querySelectorAll('.result-pdf-comment').forEach(function (commentBlock) {
|
document.querySelectorAll('.result-pdf-comment').forEach(function (commentBlock) {
|
||||||
const questionId = commentBlock.dataset.questionId;
|
const questionId = commentBlock.dataset.questionId;
|
||||||
const manualComment = document.getElementById('result-comment-' + questionId)?.value.trim() || '';
|
const manualComment = document.getElementById('result-comment-' + questionId)?.value.trim() || '';
|
||||||
|
const storedAiFeedback = commentBlock.querySelector('.result-pdf-ai-source')?.textContent.trim() || '';
|
||||||
const visibleAiFeedback = document.querySelector('.ai-feedback-screen[data-question-id="' + questionId + '"] .ai-feedback-text')?.textContent.trim() || '';
|
const visibleAiFeedback = document.querySelector('.ai-feedback-screen[data-question-id="' + questionId + '"] .ai-feedback-text')?.textContent.trim() || '';
|
||||||
const aiComment = visibleAiFeedback || commentBlock.dataset.aiComment || '';
|
const aiComment = storedAiFeedback || visibleAiFeedback;
|
||||||
const output = commentBlock.querySelector('.result-pdf-comment-text');
|
const output = commentBlock.querySelector('.result-pdf-comment-text');
|
||||||
|
|
||||||
if (output) {
|
if (output) {
|
||||||
@@ -147,6 +148,7 @@ $resolveImageUrl = static function ($path) {
|
|||||||
<div class="result-pdf-comment mt-3" data-question-id="<?php echo (int) $questionId; ?>" data-ai-comment="<?php echo htmlspecialchars($aiComment, ENT_QUOTES, 'UTF-8'); ?>">
|
<div class="result-pdf-comment mt-3" data-question-id="<?php echo (int) $questionId; ?>" data-ai-comment="<?php echo htmlspecialchars($aiComment, ENT_QUOTES, 'UTF-8'); ?>">
|
||||||
<strong><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_RESULT_COMMENT'); ?>:</strong><br>
|
<strong><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_RESULT_COMMENT'); ?>:</strong><br>
|
||||||
<span class="result-pdf-comment-text"><?php echo htmlspecialchars($printComment !== '' ? $printComment : '—', ENT_QUOTES, 'UTF-8'); ?></span>
|
<span class="result-pdf-comment-text"><?php echo htmlspecialchars($printComment !== '' ? $printComment : '—', ENT_QUOTES, 'UTF-8'); ?></span>
|
||||||
|
<span class="result-pdf-ai-source" hidden><?php echo htmlspecialchars($aiComment, ENT_QUOTES, 'UTF-8'); ?></span>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if (empty($answer['correct'])) : ?>
|
<?php if (empty($answer['correct'])) : ?>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<creationDate>2026-10-14</creationDate>
|
<creationDate>2026-10-14</creationDate>
|
||||||
<author>Komponent</author>
|
<author>Komponent</author>
|
||||||
<license>GNU General Public License version 2 or later</license>
|
<license>GNU General Public License version 2 or later</license>
|
||||||
<version>1.43.38</version>
|
<version>1.43.39</version>
|
||||||
<description>COM_TESTQUESTIONS_DESCRIPTION</description>
|
<description>COM_TESTQUESTIONS_DESCRIPTION</description>
|
||||||
<element>com_testquestions</element>
|
<element>com_testquestions</element>
|
||||||
<namespace path="src">Komponent\Component\Testquestions</namespace>
|
<namespace path="src">Komponent\Component\Testquestions</namespace>
|
||||||
|
|||||||
Reference in New Issue
Block a user