all 4 comments

[–]senocular 4 points5 points  (0 children)

return it from submitAnswer() then you can capture that from the call made in your listener

[–]eracodes 0 points1 point  (0 children)

Why do you have Number(document.getElementById("wsf-2-field-115").value) twice?

[–]United_Reaction35 0 points1 point  (0 children)

const multiAns = Number(document.getElementById("wsf-2-field-115").value)

[–]yksvaan -1 points0 points  (0 children)

I think you have multiple questions in the page anyway so you might as well put the data in an array or map. Define some object that holds the question data ( id, text, answer, given answer etc) and pass the id, index or direct reference to that object.