From 2bc1b307046c8b4f5b4394a95116299531b03140 Mon Sep 17 00:00:00 2001 From: Wojtek Date: Sat, 17 Oct 2026 12:44:42 +0200 Subject: [PATCH] Show partial assessment status for open answers --- README.md | 2 +- .../language/en-GB/com_testquestions.ini | 1 + .../com_testquestions/sql/updates/mysql/1.43.34.sql | 1 + .../com_testquestions/tmpl/result/default.php | 12 +++++++++++- com_testquestions.xml | 2 +- 5 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 administrator/components/com_testquestions/sql/updates/mysql/1.43.34.sql diff --git a/README.md b/README.md index 8ebf593..dcdd65b 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.33). +W Joomla wybierz **System → Install → Install from Folder** i wskaż ten katalog. Manifestem instalacyjnym jest `com_testquestions.xml` (wersja 1.43.34). Po instalacji komponent jest dostępny w panelu administratora jako **Pytania testowe**. diff --git a/administrator/components/com_testquestions/language/en-GB/com_testquestions.ini b/administrator/components/com_testquestions/language/en-GB/com_testquestions.ini index dedc7b3..1f30f14 100644 --- a/administrator/components/com_testquestions/language/en-GB/com_testquestions.ini +++ b/administrator/components/com_testquestions/language/en-GB/com_testquestions.ini @@ -150,6 +150,7 @@ COM_TESTQUESTIONS_YOUR_ANSWER="Twoja odpowiedź" COM_TESTQUESTIONS_SELECTED_ANSWER="Zaznaczona odpowiedź" COM_TESTQUESTIONS_ANSWER_CORRECT="Poprawna odpowiedź" COM_TESTQUESTIONS_ANSWER_INCORRECT="Niepoprawna odpowiedź" +COM_TESTQUESTIONS_ANSWER_PARTIALLY_CORRECT="Odpowiedź częściowo poprawna" COM_TESTQUESTIONS_CORRECT_PATTERN="Wzorzec poprawnej odpowiedzi" COM_TESTQUESTIONS_SUBJECT="Przedmiot" COM_TESTQUESTIONS_SUBJECT_TITLE="Nazwa przedmiotu" diff --git a/administrator/components/com_testquestions/sql/updates/mysql/1.43.34.sql b/administrator/components/com_testquestions/sql/updates/mysql/1.43.34.sql new file mode 100644 index 0000000..4745ad4 --- /dev/null +++ b/administrator/components/com_testquestions/sql/updates/mysql/1.43.34.sql @@ -0,0 +1 @@ +-- Brak zmian w schemacie bazy danych w wersji 1.43.34. diff --git a/administrator/components/com_testquestions/tmpl/result/default.php b/administrator/components/com_testquestions/tmpl/result/default.php index cee56c9..0b679aa 100644 --- a/administrator/components/com_testquestions/tmpl/result/default.php +++ b/administrator/components/com_testquestions/tmpl/result/default.php @@ -77,6 +77,16 @@ $resolveImageUrl = static function ($path) { item->answers as $questionId => $answer) : ?> item->questions[(int) $questionId] ?? null; if (!$question) continue; ?> + question_type === 'open' && array_key_exists('awarded_points', $answer)) { + $awardedPoints = (int) $answer['awarded_points']; + $maximumPoints = (int) ($question->points ?? 0); + $answerStatusCorrect = $awardedPoints > 0 && $awardedPoints >= $maximumPoints; + $answerStatusPartial = $awardedPoints > 0 && !$answerStatusCorrect; + } + ?>
question; ?>
image)) : ?>
@@ -86,7 +96,7 @@ $resolveImageUrl = static function ($path) {
:
-
+
question_type === 'open' && $hasResponse) : ?>
diff --git a/com_testquestions.xml b/com_testquestions.xml index f84741e..5685ac2 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.33 + 1.43.34 COM_TESTQUESTIONS_DESCRIPTION com_testquestions Komponent\Component\Testquestions