Hello All,
I am heavily struggling with getting the below function to be called in C2. Essentially what I am doing, is defining a set number of times for the Correct Answer to occur and when it does occur returns a 1 that I can then display in C2. However, I can't get this to pop in C2 at all...
I've thoroughly tested the code from a javascript perspective in my environment and it's running perfectly, returning exactly what I expect every step of the way. I have spent too many hours at this point trying to figure the C2 piece out so I am here to ask for help/direction.
I would be happy to donate or pay for any assistance.
The function that exists on my website, in the same .js as other functions that I am having no difficulties calling, is shown below. I want it to run in Construct 2, and then return the Value 1 into Construct 2 as a global variable.
When an event occurs, (e.g. Timer = 0) run this function, a popup occurs on my website and requires you to answer some questions. If you answer the specified number of questions correctly it returns a 1.
function WaitForCorrectAnswers(num){
var numCorrect = 0;
var correctFlag;
var timer=setInterval(checkAnswer,100);
function checkAnswer(){
correctFlag = ShiftCorrectFlag();
if (correctFlag > 0){
numCorrect++;
}
if (numCorrect >= num){
clearInterval(timer);
var done;
done = 1;
return done;
}
}
}
Appreciate any and all help!
Thanks,
Warren