diff --git a/README.md b/README.md index f5f8f97..15a8de9 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.23.0). +W Joomla wybierz **System → Install → Install from Folder** i wskaż ten katalog. Manifestem instalacyjnym jest `com_testquestions.xml` (wersja 1.24.0). 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 c5e2eb1..993f736 100644 --- a/administrator/components/com_testquestions/language/en-GB/com_testquestions.ini +++ b/administrator/components/com_testquestions/language/en-GB/com_testquestions.ini @@ -71,7 +71,7 @@ COM_TESTQUESTIONS_RESULT_POINTS_BEFORE_AFTER="Punkty przed / po korekcie" COM_TESTQUESTIONS_RESULT_DATE="Data zakończenia" COM_TESTQUESTIONS_RESULT_ANSWERS="Odpowiedzi" COM_TESTQUESTIONS_RESULT_EXECUTION_TIME="Czas wykonania" -COM_TESTQUESTIONS_RESULT_AWARDED_POINTS="Uznane punkty" +COM_TESTQUESTIONS_RESULT_AWARDED_POINTS="Uznane punkty (maksymalnie %s)" COM_TESTQUESTIONS_RESULT_COMMENT="Komentarz" COM_TESTQUESTIONS_RESULT_SAVED="Dane wyniku zostały zapisane." COM_TESTQUESTIONS_RESULTS_SEARCH="Szukaj po użytkowniku lub zestawie..." diff --git a/administrator/components/com_testquestions/sql/updates/mysql/1.24.0.sql b/administrator/components/com_testquestions/sql/updates/mysql/1.24.0.sql new file mode 100644 index 0000000..51a5dea --- /dev/null +++ b/administrator/components/com_testquestions/sql/updates/mysql/1.24.0.sql @@ -0,0 +1 @@ +-- No database changes required for version 1.24.0. diff --git a/administrator/components/com_testquestions/src/Model/ResultModel.php b/administrator/components/com_testquestions/src/Model/ResultModel.php index 45c5622..5023377 100644 --- a/administrator/components/com_testquestions/src/Model/ResultModel.php +++ b/administrator/components/com_testquestions/src/Model/ResultModel.php @@ -52,7 +52,8 @@ class ResultModel extends BaseDatabaseModel foreach ($item->answers as $questionId => &$answer) { $key = (string) $questionId; - $answer['awarded_points'] = max(0, (int) ($awardedPoints[$key] ?? 0)); + $maxPoints = (int) ($item->questions[(int) $questionId]->points ?? 0); + $answer['awarded_points'] = min($maxPoints, max(0, (int) ($awardedPoints[$key] ?? 0))); $answer['comment'] = trim((string) ($comments[$key] ?? '')); } unset($answer); diff --git a/administrator/components/com_testquestions/tmpl/result/default.php b/administrator/components/com_testquestions/tmpl/result/default.php index 7db6970..7afc3f8 100644 --- a/administrator/components/com_testquestions/tmpl/result/default.php +++ b/administrator/components/com_testquestions/tmpl/result/default.php @@ -33,8 +33,8 @@
- - + +
diff --git a/com_testquestions.xml b/com_testquestions.xml index 295f104..4fef381 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.23.0 + 1.24.0 COM_TESTQUESTIONS_DESCRIPTION com_testquestions Komponent\Component\Testquestions