Help My ARIA Labels contain variable name versus value
I am hoping someone in the community can help me out as I have been fighting this for a while now. I have a custom quiz that in the remediation page displays all the user inputed answers through their assigned variable. The on screen functions of this work perfectly, but when I review the slide with a screen reader the ARIA label for each of these items is only reading the variable name not the variable value. So for instance it will say "dollar sign dollar sign variable dollar sign dollar sign" instead of "Red".
I have seen another post with someone asking a similar question and someone provided a sample project that seems to have fixed this issue, but they have not provided any information on how they accomplished this. I have even tried contacting the OP of that sample and no response.
This is really detrimental to my project and there is really no other way to gather and display this information beyond what I have programmed already.
I am a serious beginner when I comes to javascript and have been reading a lot trying to figure this out. What I have come up with so far is below, but it doesn't work, or I am putting it in the wrong place. Any help that could be provided would be really appreciated as this is driving me crazy.
var answer = interfaceObj.getVariableValue("Q1Answer");
document.getElementById("Q1Answer_589").setAttribute("aria-label", answer);
