Fix: TinyMCE skin + toggleCorrect исправлен
✅ TinyMCE: добавлены skin: 'oxide' и content_css: 'default' ✅ toggleCorrect: использует querySelector вместо previousElementSibling ✅ Добавлено переключение классов btn-success/btn-outline-success Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
parent
ba4a16c7f9
commit
7f10576181
|
|
@ -100,6 +100,8 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||||
selector: '#questionText, #questionExplanation',
|
selector: '#questionText, #questionExplanation',
|
||||||
license_key: 'gpl',
|
license_key: 'gpl',
|
||||||
language: 'ru',
|
language: 'ru',
|
||||||
|
skin: 'oxide',
|
||||||
|
content_css: 'default',
|
||||||
height: 300,
|
height: 300,
|
||||||
plugins: 'image link table lists code',
|
plugins: 'image link table lists code',
|
||||||
toolbar: 'undo redo | formatselect | bold italic | alignleft aligncenter alignright | bullist numlist | image link | code',
|
toolbar: 'undo redo | formatselect | bold italic | alignleft aligncenter alignright | bullist numlist | image link | code',
|
||||||
|
|
@ -146,9 +148,19 @@ function addAnswer() {
|
||||||
}
|
}
|
||||||
function removeAnswer(btn) { btn.parentElement.remove(); }
|
function removeAnswer(btn) { btn.parentElement.remove(); }
|
||||||
function toggleCorrect(btn) {
|
function toggleCorrect(btn) {
|
||||||
const hidden = btn.previousElementSibling.previousElementSibling;
|
const inputGroup = btn.parentElement;
|
||||||
if (hidden.value === '0') { hidden.value = '1'; btn.innerHTML = '<i class="bi bi-check-circle-fill text-success"></i>'; }
|
const hidden = inputGroup.querySelector('input[type="hidden"][name*="is_correct"]');
|
||||||
else { hidden.value = '0'; btn.innerHTML = '<i class="bi bi-circle"></i>'; }
|
if (hidden.value === '0') {
|
||||||
|
hidden.value = '1';
|
||||||
|
btn.innerHTML = '<i class="bi bi-check-circle-fill text-success"></i>';
|
||||||
|
btn.classList.remove('btn-outline-success');
|
||||||
|
btn.classList.add('btn-success');
|
||||||
|
} else {
|
||||||
|
hidden.value = '0';
|
||||||
|
btn.innerHTML = '<i class="bi bi-circle"></i>';
|
||||||
|
btn.classList.remove('btn-success');
|
||||||
|
btn.classList.add('btn-outline-success');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function addMatchingPair() {
|
function addMatchingPair() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue