feat(frontend): Vue can now interact with the chosen answers for questions.
This commit is contained in:
parent
6d452c7f72
commit
63d1ed8bd2
6 changed files with 99 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue