Attempt to fix aimation of question reveals
This commit is contained in:
parent
fd190a5e3d
commit
543c1790de
3 changed files with 27 additions and 11 deletions
|
|
@ -13,13 +13,17 @@ export default class extends Controller {
|
|||
submitAnswer(ev) {
|
||||
ev.preventDefault();
|
||||
|
||||
this.radioTargets.forEach(e => {
|
||||
e.disabled = true;
|
||||
if (e.value === this.answerValue) {
|
||||
e.classList.add("answer");
|
||||
} else {
|
||||
e.classList.add("wrong");
|
||||
}
|
||||
});
|
||||
this.element.classList.add("reveal");
|
||||
|
||||
window.setTimeout(() => {
|
||||
this.radioTargets.forEach(e => {
|
||||
e.disabled = true;
|
||||
if (e.value === this.answerValue) {
|
||||
e.classList.add("answer");
|
||||
} else {
|
||||
e.classList.add("wrong");
|
||||
}
|
||||
});
|
||||
}, 1);
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue