Use seconds slider for test duration

This commit is contained in:
Wojtek
2026-10-15 17:32:33 +02:00
parent 197a03a2d0
commit 0c3ae353a5
6 changed files with 27 additions and 6 deletions
@@ -12,6 +12,7 @@ HTMLHelper::_('behavior.formvalidator');
<?php echo $this->form->renderField('title'); ?>
<?php echo $this->form->renderField('subject_id'); ?>
<?php echo $this->form->renderField('duration'); ?>
<output id="set-duration-value" class="form-text mb-3"></output>
<?php echo $this->form->renderField('test_content'); ?>
<?php echo $this->form->renderField('image'); ?>
<?php echo $this->form->renderField('description'); ?>
@@ -101,3 +102,20 @@ document.addEventListener('DOMContentLoaded', function () {
});
});
</script>
<script>
document.addEventListener('DOMContentLoaded', function () {
const duration = document.getElementById('jform_duration');
const output = document.getElementById('set-duration-value');
if (!duration || !output) {
return;
}
const updateDuration = function () {
output.textContent = duration.value + ' s';
};
duration.addEventListener('input', updateDuration);
updateDuration();
});
</script>