Hi,
In my survey, I have a task that participants can answer easily by using the internet.
Because of that, I am looking for function that find out participants who leave the survey window.
I tried this, with embedded data variable called "RAT1":
Qualtrics.SurveyEngine.addOnReady(function()
{
var RAT1 = Boolean(("${e://Field/RAT1}"))
document.addEventListener("visibilitychange", function() {
console.log(document.hidden);
RAT1 = document.hidden;
Qualtrics.SurveyEngine.setEmbeddedData('RAT1',RAT1);
})
});
unfortunately, it is not working for me.
maybe someone could help?
Page 1 / 1
Your function gets activated everytime there is a visibility change. Hence, when a person comes back to your survey,
document.hiddenwill become
trueagain.
I suggest using a counter. Start with zero, if its value is more than one, then set the embedded variable.
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.