Javascript - script to update text not working
Hi - I'm trying to set a feedback layer to a multiple choice question to display different text depending on which answers are given (the user can select more than one answer)
So if they select wrong answer 1 - it adds feedback 1
If they select wrong answer 2 - it adds feedback 2
If they select wrong answer 3 - it adds feedback 3
so, for example, selecting wrong answers 1 & 3 gets feedback 1 & 3, skipping out 2.
____
I'm using Javascript to add the feedback, executing if they've selected a given response. The variable to check which response they've given is being used elsewhere on screen and working well, so I think the problem must be in my Javascript.
var player = GetPlayer();
var newfeedback = player.GetVar("feedback1pt7") + "Feedback Text 1<br/><br/>";
player.SetVar("feedback1pt7", newfeedback);
I used this project as the basis: https://community.articulate.com/discussions/articulate-storyline/append-text-to-an-existing-text-variable
Thanks!