From 3eabeebf6b499b04ff0323beb2ff69353619d1c5 Mon Sep 17 00:00:00 2001 From: Wojtek Date: Thu, 15 Oct 2026 19:50:39 +0200 Subject: [PATCH] Warn with timer colors near timeout --- README.md | 2 +- .../components/com_testquestions/sql/updates/mysql/1.16.3.sql | 1 + com_testquestions.xml | 2 +- components/com_testquestions/tmpl/set/default.php | 2 ++ 4 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 administrator/components/com_testquestions/sql/updates/mysql/1.16.3.sql diff --git a/README.md b/README.md index 1e2fd9b..e7d3cb2 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,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.16.2). +W Joomla wybierz **System → Install → Install from Folder** i wskaż ten katalog. Manifestem instalacyjnym jest `com_testquestions.xml` (wersja 1.16.3). Po instalacji komponent jest dostępny w panelu administratora jako **Pytania testowe**. diff --git a/administrator/components/com_testquestions/sql/updates/mysql/1.16.3.sql b/administrator/components/com_testquestions/sql/updates/mysql/1.16.3.sql new file mode 100644 index 0000000..6e7ddef --- /dev/null +++ b/administrator/components/com_testquestions/sql/updates/mysql/1.16.3.sql @@ -0,0 +1 @@ +-- No database changes required for version 1.16.3. diff --git a/com_testquestions.xml b/com_testquestions.xml index 4a150f7..6b22f79 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.16.2 + 1.16.3 COM_TESTQUESTIONS_DESCRIPTION com_testquestions Komponent\Component\Testquestions diff --git a/components/com_testquestions/tmpl/set/default.php b/components/com_testquestions/tmpl/set/default.php index c02898a..52b1f38 100644 --- a/components/com_testquestions/tmpl/set/default.php +++ b/components/com_testquestions/tmpl/set/default.php @@ -127,8 +127,10 @@ document.addEventListener('DOMContentLoaded', function () { const update = function () { const minutes = Math.floor(remaining / 60); const seconds = remaining % 60; + const ratio = remaining / total; text.textContent = String(minutes).padStart(2, '0') + ':' + String(seconds).padStart(2, '0'); ring.style.strokeDashoffset = circumference * (1 - remaining / total); + ring.style.stroke = ratio <= 0.1 ? '#dc3545' : (ratio <= 0.2 ? '#fd7e14' : '#4a86cf'); if (remaining <= 0 && !submitted) { submitted = true;