feat(frontend): Vue can now interact with the chosen answers for questions.

This commit is contained in:
Gerald Schmittinger 2025-04-16 13:02:13 +02:00
parent 6d452c7f72
commit 63d1ed8bd2
6 changed files with 99 additions and 1 deletions

View file

@ -0,0 +1,13 @@
export const essayQuestionAdapter: GiftAdapter = {
questionType: "Essay",
installListener(questionElement: Element, answerUpdateCallback: (newAnswer: string | number | object) => void): void {
const textArea = questionElement.querySelector('textarea')!;
textArea.addEventListener('input', () => answerUpdateCallback(textArea.value));
},
setAnswer(questionElement: Element, answer: string | number | object): void {
const textArea = questionElement.querySelector('textarea')!;
textArea.value = String(answer);
}
}