Compare commits

...
1 Commits
Author SHA1 Message Date
Wojtek 09cb36a8ea Number and highlight questions in result details 2026-10-17 13:32:32 +02:00
4 changed files with 10 additions and 3 deletions
+1 -1
View File
@@ -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.44). W Joomla wybierz **System → Install → Install from Folder** i wskaż ten katalog. Manifestem instalacyjnym jest `com_testquestions.xml` (wersja 1.43.45).
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.45.
@@ -32,6 +32,7 @@ $resolveImageUrl = static function ($path) {
article { break-inside: auto; border-color: #aaa !important; } article { break-inside: auto; border-color: #aaa !important; }
img { max-width: 100% !important; max-height: 150mm; object-fit: contain; } img { max-width: 100% !important; max-height: 150mm; object-fit: contain; }
.alert { print-color-adjust: exact; -webkit-print-color-adjust: exact; } .alert { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.result-question-heading { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.container-fluid .result-pdf-comment.has-print-comment { display: block !important; } .container-fluid .result-pdf-comment.has-print-comment { display: block !important; }
.result-pdf-comment-text { white-space: pre-wrap; } .result-pdf-comment-text { white-space: pre-wrap; }
.ai-token-info { display: none !important; } .ai-token-info { display: none !important; }
@@ -122,8 +123,10 @@ $resolveImageUrl = static function ($path) {
</div> </div>
<?php endif; ?> <?php endif; ?>
<h2><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_RESULT_ANSWERS'); ?></h2> <h2><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_RESULT_ANSWERS'); ?></h2>
<?php $questionNumber = 0; ?>
<?php foreach ($this->item->answers as $questionId => $answer) : ?> <?php foreach ($this->item->answers as $questionId => $answer) : ?>
<?php $question = $this->item->questions[(int) $questionId] ?? null; if (!$question) continue; ?> <?php $question = $this->item->questions[(int) $questionId] ?? null; if (!$question) continue; ?>
<?php $questionNumber++; ?>
<?php $hasResponse = trim((string) ($answer['selected'] ?? '')) !== ''; ?> <?php $hasResponse = trim((string) ($answer['selected'] ?? '')) !== ''; ?>
<?php <?php
$answerStatusCorrect = !empty($answer['correct']); $answerStatusCorrect = !empty($answer['correct']);
@@ -149,7 +152,10 @@ $resolveImageUrl = static function ($path) {
$printComment = $manualComment !== '' ? $manualComment : $aiComment; $printComment = $manualComment !== '' ? $manualComment : $aiComment;
?> ?>
<article class="mb-4 border rounded p-3"> <article class="mb-4 border rounded p-3">
<div class="mb-2"><?php echo $question->question; ?></div> <div class="result-question-heading d-flex align-items-start gap-2 mb-3 p-3 bg-light border-start border-4 border-primary rounded">
<span class="badge text-bg-primary flex-shrink-0"><?php echo $questionNumber; ?>.</span>
<div class="fw-semibold"><?php echo $question->question; ?></div>
</div>
<?php if (!empty($question->image)) : ?><div class="mb-3"><img src="<?php echo htmlspecialchars($resolveImageUrl($question->image), ENT_QUOTES, 'UTF-8'); ?>" alt="" loading="lazy" style="max-width: 100%; height: auto;"></div><?php endif; ?> <?php if (!empty($question->image)) : ?><div class="mb-3"><img src="<?php echo htmlspecialchars($resolveImageUrl($question->image), ENT_QUOTES, 'UTF-8'); ?>" alt="" loading="lazy" style="max-width: 100%; height: auto;"></div><?php endif; ?>
<?php if ($question->question_type === 'open') : ?> <?php if ($question->question_type === 'open') : ?>
<div><strong><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_YOUR_ANSWER'); ?>:</strong> <?php echo htmlspecialchars($answer['selected'] ?: '—', ENT_QUOTES, 'UTF-8'); ?></div> <div><strong><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_YOUR_ANSWER'); ?>:</strong> <?php echo htmlspecialchars($answer['selected'] ?: '—', ENT_QUOTES, 'UTF-8'); ?></div>
+1 -1
View File
@@ -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.44</version> <version>1.43.45</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>