style: fix linting issues met Prettier
This commit is contained in:
parent
af8c783a26
commit
5168ceaee0
56 changed files with 680 additions and 741 deletions
|
@ -1,11 +1,14 @@
|
|||
export const multipleChoiceQuestionAdapter: GiftAdapter = {
|
||||
questionType: "MC",
|
||||
|
||||
installListener(questionElement: Element, answerUpdateCallback: (newAnswer: string | number | object) => void): void {
|
||||
questionElement.querySelectorAll('input[type=radio]').forEach(element => {
|
||||
installListener(
|
||||
questionElement: Element,
|
||||
answerUpdateCallback: (newAnswer: string | number | object) => void,
|
||||
): void {
|
||||
questionElement.querySelectorAll("input[type=radio]").forEach((element) => {
|
||||
const input = element as HTMLInputElement;
|
||||
|
||||
input.addEventListener('change', () => {
|
||||
input.addEventListener("change", () => {
|
||||
answerUpdateCallback(parseInt(input.value));
|
||||
});
|
||||
// Optional: initialize value if already selected
|
||||
|
@ -16,9 +19,9 @@ export const multipleChoiceQuestionAdapter: GiftAdapter = {
|
|||
},
|
||||
|
||||
setAnswer(questionElement: Element, answer: string | number | object): void {
|
||||
questionElement.querySelectorAll('input[type=radio]').forEach(element => {
|
||||
questionElement.querySelectorAll("input[type=radio]").forEach((element) => {
|
||||
const input = element as HTMLInputElement;
|
||||
input.checked = String(answer) === String(input.value);
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue