From 1d4779089db7c1c962960bd96596d82aed469454 Mon Sep 17 00:00:00 2001 From: Wojtek Date: Wed, 14 Oct 2026 22:33:35 +0200 Subject: [PATCH] Add optional exam sheet metadata --- README.md | 3 ++- .../components/com_testquestions/forms/question.xml | 3 +++ .../com_testquestions/language/en-GB/com_testquestions.ini | 6 ++++++ .../com_testquestions/sql/install.mysql.utf8mb4.sql | 3 +++ .../com_testquestions/sql/updates/mysql/1.4.0.sql | 4 ++++ .../components/com_testquestions/tmpl/question/edit.php | 3 +++ com_testquestions.xml | 2 +- 7 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 administrator/components/com_testquestions/sql/updates/mysql/1.4.0.sql diff --git a/README.md b/README.md index 39812e6..6d96250 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Szkielet komponentu Joomla 6 do gromadzenia pytań testowych. - edytor formatowania treści pytania i odpowiedzi zamkniętych, - czas odpowiedzi, punktacja 1–9 oraz zarządzalne kategorie pytań, - filtrowanie listy pytań po kategorii, +- opcjonalny symbol testu, rok egzaminu i numer pytania z arkusza, - wskazanie poprawnej odpowiedzi, - opcjonalne zdjęcie wybierane z Media Managera, - publikowanie, filtrowanie i usuwanie pytań w panelu administratora, @@ -16,6 +17,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.3.2). +W Joomla wybierz **System → Install → Install from Folder** i wskaż ten katalog. Manifestem instalacyjnym jest `com_testquestions.xml` (wersja 1.4.0). Po instalacji komponent jest dostępny w panelu administratora jako **Pytania testowe**. diff --git a/administrator/components/com_testquestions/forms/question.xml b/administrator/components/com_testquestions/forms/question.xml index 679465d..818eb17 100644 --- a/administrator/components/com_testquestions/forms/question.xml +++ b/administrator/components/com_testquestions/forms/question.xml @@ -16,6 +16,9 @@ + + + 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 158306d..387a7d0 100644 --- a/administrator/components/com_testquestions/language/en-GB/com_testquestions.ini +++ b/administrator/components/com_testquestions/language/en-GB/com_testquestions.ini @@ -7,6 +7,12 @@ COM_TESTQUESTIONS_FIELD_TYPE="Typ pytania" COM_TESTQUESTIONS_FIELD_CATEGORY="Kategoria" COM_TESTQUESTIONS_FIELD_TIME_LIMIT="Czas na odpowiedź" COM_TESTQUESTIONS_FIELD_POINTS="Liczba punktów" +COM_TESTQUESTIONS_FIELD_TEST_SYMBOL="Symbol testu" +COM_TESTQUESTIONS_FIELD_TEST_SYMBOL_DESC="Opcjonalny symbol arkusza lub testu egzaminacyjnego." +COM_TESTQUESTIONS_FIELD_EXAM_YEAR="Rok egzaminu" +COM_TESTQUESTIONS_FIELD_EXAM_YEAR_DESC="Opcjonalny rok przeprowadzenia egzaminu." +COM_TESTQUESTIONS_FIELD_QUESTION_NUMBER="Numer pytania" +COM_TESTQUESTIONS_FIELD_QUESTION_NUMBER_DESC="Opcjonalny numer pytania w arkuszu egzaminacyjnym." COM_TESTQUESTIONS_MANAGE_CATEGORIES="Kategorie" COM_TESTQUESTIONS_FILTER_CATEGORY="Wszystkie kategorie" COM_TESTQUESTIONS_CATEGORIES="Kategorie pytań" diff --git a/administrator/components/com_testquestions/sql/install.mysql.utf8mb4.sql b/administrator/components/com_testquestions/sql/install.mysql.utf8mb4.sql index 157b70a..4f278fc 100644 --- a/administrator/components/com_testquestions/sql/install.mysql.utf8mb4.sql +++ b/administrator/components/com_testquestions/sql/install.mysql.utf8mb4.sql @@ -3,6 +3,9 @@ CREATE TABLE IF NOT EXISTS `#__testquestions_questions` ( `category_id` int unsigned NOT NULL DEFAULT 0, `time_limit` smallint unsigned NOT NULL DEFAULT 60, `points` tinyint unsigned NOT NULL DEFAULT 1, + `test_symbol` varchar(100) NOT NULL DEFAULT '', + `exam_year` smallint unsigned NULL DEFAULT NULL, + `question_number` smallint unsigned NULL DEFAULT NULL, `question_type` varchar(10) NOT NULL DEFAULT 'closed', `question` text NOT NULL, `answer_a` text NOT NULL, diff --git a/administrator/components/com_testquestions/sql/updates/mysql/1.4.0.sql b/administrator/components/com_testquestions/sql/updates/mysql/1.4.0.sql new file mode 100644 index 0000000..a598d02 --- /dev/null +++ b/administrator/components/com_testquestions/sql/updates/mysql/1.4.0.sql @@ -0,0 +1,4 @@ +ALTER TABLE `#__testquestions_questions` + ADD COLUMN `test_symbol` varchar(100) NOT NULL DEFAULT '' AFTER `points`, + ADD COLUMN `exam_year` smallint unsigned NULL DEFAULT NULL AFTER `test_symbol`, + ADD COLUMN `question_number` smallint unsigned NULL DEFAULT NULL AFTER `exam_year`; diff --git a/administrator/components/com_testquestions/tmpl/question/edit.php b/administrator/components/com_testquestions/tmpl/question/edit.php index b502389..807f911 100644 --- a/administrator/components/com_testquestions/tmpl/question/edit.php +++ b/administrator/components/com_testquestions/tmpl/question/edit.php @@ -18,6 +18,9 @@ defined('_JEXEC') or die; form->renderField('category_id'); ?> form->renderField('time_limit'); ?> form->renderField('points'); ?> + form->renderField('test_symbol'); ?> + form->renderField('exam_year'); ?> + form->renderField('question_number'); ?> form->renderField('image'); ?> form->renderField('published'); ?> diff --git a/com_testquestions.xml b/com_testquestions.xml index 71da755..b602f8c 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.3.2 + 1.4.0 COM_TESTQUESTIONS_DESCRIPTION com_testquestions Komponent\Component\Testquestions