Initial Joomla test questions component

This commit is contained in:
Wojtek
2026-10-14 22:29:10 +02:00
commit 9b093b278d
44 changed files with 964 additions and 0 deletions
@@ -0,0 +1,19 @@
CREATE TABLE IF NOT EXISTS `#__testquestions_questions` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`question` text NOT NULL,
`answer_a` varchar(500) NOT NULL,
`answer_b` varchar(500) NOT NULL,
`answer_c` varchar(500) NOT NULL,
`answer_d` varchar(500) NOT NULL,
`correct_answer` tinyint unsigned NOT NULL DEFAULT 0,
`image` varchar(1024) NOT NULL DEFAULT '',
`published` tinyint NOT NULL DEFAULT 1,
`ordering` int NOT NULL DEFAULT 0,
`created` datetime NOT NULL,
`created_by` int unsigned NOT NULL DEFAULT 0,
`modified` datetime NULL DEFAULT NULL,
`modified_by` int unsigned NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `idx_published` (`published`),
KEY `idx_ordering` (`ordering`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;
@@ -0,0 +1 @@
-- Joomla 6 compatibility update: language strings now use Joomla CMS Text API.
@@ -0,0 +1,3 @@
ALTER TABLE `#__testquestions_questions`
ADD COLUMN `question_type` varchar(10) NOT NULL DEFAULT 'closed' AFTER `id`,
ADD COLUMN `answer_open` text NULL AFTER `answer_d`;
@@ -0,0 +1 @@
-- Validation update for open and closed question forms.
@@ -0,0 +1,5 @@
ALTER TABLE `#__testquestions_questions`
MODIFY COLUMN `answer_a` text NOT NULL,
MODIFY COLUMN `answer_b` text NOT NULL,
MODIFY COLUMN `answer_c` text NOT NULL,
MODIFY COLUMN `answer_d` text NOT NULL;
@@ -0,0 +1 @@
-- Controller update: cancel returns to the questions list.
@@ -0,0 +1 @@
-- Direct cancel link for the question editor.
@@ -0,0 +1,16 @@
CREATE TABLE IF NOT EXISTS `#__testquestions_categories` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(150) NOT NULL,
`published` tinyint NOT NULL DEFAULT 1,
`ordering` int NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
UNIQUE KEY `idx_title` (`title`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;
INSERT IGNORE INTO `#__testquestions_categories` (`id`, `title`, `published`, `ordering`)
VALUES (1, 'Bez kategorii', 1, 0);
ALTER TABLE `#__testquestions_questions`
ADD COLUMN `category_id` int unsigned NOT NULL DEFAULT 1 AFTER `id`,
ADD COLUMN `time_limit` smallint unsigned NOT NULL DEFAULT 60 AFTER `category_id`,
ADD COLUMN `points` tinyint unsigned NOT NULL DEFAULT 1 AFTER `time_limit`;
@@ -0,0 +1 @@
-- Category cancel action returns to the questions list.
@@ -0,0 +1 @@
-- Category filter for the administrator question list.