Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0a6253dbe |
@@ -17,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.4.1).
|
||||
W Joomla wybierz **System → Install → Install from Folder** i wskaż ten katalog. Manifestem instalacyjnym jest `com_testquestions.xml` (wersja 1.4.2).
|
||||
|
||||
Po instalacji komponent jest dostępny w panelu administratora jako **Pytania testowe**.
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
<option value="7">7</option><option value="8">8</option><option value="9">9</option>
|
||||
</field>
|
||||
<field name="test_symbol" type="text" label="COM_TESTQUESTIONS_FIELD_TEST_SYMBOL" required="false" maxlength="100" filter="string" />
|
||||
<field name="exam_year" type="number" label="COM_TESTQUESTIONS_FIELD_EXAM_YEAR" required="false" min="1900" max="2100" filter="integer" showon="test_symbol!:''" />
|
||||
<field name="question_number" type="number" label="COM_TESTQUESTIONS_FIELD_QUESTION_NUMBER" required="false" min="1" max="9999" filter="integer" showon="test_symbol!:''" />
|
||||
<field name="exam_year" type="number" label="COM_TESTQUESTIONS_FIELD_EXAM_YEAR" required="false" min="1900" max="2100" filter="integer" />
|
||||
<field name="question_number" type="number" label="COM_TESTQUESTIONS_FIELD_QUESTION_NUMBER" required="false" min="1" max="9999" filter="integer" />
|
||||
<field name="question_type" type="list" label="COM_TESTQUESTIONS_FIELD_TYPE" default="closed" required="true">
|
||||
<option value="closed">COM_TESTQUESTIONS_TYPE_CLOSED</option>
|
||||
<option value="open">COM_TESTQUESTIONS_TYPE_OPEN</option>
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
-- Toggle exam metadata fields based on the test symbol in the question form.
|
||||
@@ -34,3 +34,31 @@ defined('_JEXEC') or die;
|
||||
<input type="hidden" name="task" value="question.save">
|
||||
<?php echo Joomla\CMS\HTML\HTMLHelper::_('form.token'); ?>
|
||||
</form>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const symbol = document.getElementById('jform_test_symbol');
|
||||
const fields = ['jform_exam_year', 'jform_question_number'];
|
||||
|
||||
if (!symbol) {
|
||||
return;
|
||||
}
|
||||
|
||||
const toggleExamFields = function () {
|
||||
const show = symbol.value.trim() !== '';
|
||||
|
||||
fields.forEach(function (id) {
|
||||
const field = document.getElementById(id);
|
||||
const wrapper = field ? field.closest('.control-group, .form-group') : null;
|
||||
|
||||
if (wrapper) {
|
||||
wrapper.classList.toggle('hidden', !show);
|
||||
wrapper.style.display = show ? '' : 'none';
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
symbol.addEventListener('input', toggleExamFields);
|
||||
symbol.addEventListener('change', toggleExamFields);
|
||||
toggleExamFields();
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<creationDate>2026-10-14</creationDate>
|
||||
<author>Komponent</author>
|
||||
<license>GNU General Public License version 2 or later</license>
|
||||
<version>1.4.1</version>
|
||||
<version>1.4.2</version>
|
||||
<description>COM_TESTQUESTIONS_DESCRIPTION</description>
|
||||
<element>com_testquestions</element>
|
||||
<namespace path="src">Komponent\Component\Testquestions</namespace>
|
||||
|
||||
Reference in New Issue
Block a user