Hi guys, I need to conduct a psychology experiment asking participants to type in their thought within certain time limits. Whenever they press the blue button, a new text block will appear and hide the previous one. This will last for 12 mins. This is the Javascript I use:
Qualtrics.SurveyEngine.addOnload(function()
{
let loopNumber = Number("${lm://CurrentLoopNumber}")
if (loopNumber > 1) {
let timeLimit = "${e://Field/time_limit}"
let startTime ="${e://Field/start_time}"
let currentTime = new Date().getTime()
console.log("Loop: " + loopNumber)
console.log("Start Time: " + startTime)
console.log("Current Time: " + currentTime)
let timeElapsed = currentTime - startTime
console.log("Time elapsed: " + timeElapsed)
if(currentTime - startTime >= timeLimit) {
Qualtrics.SurveyEngine.setEmbeddedData("time_is_up", 1);
this.clickNextButton()
}
}
});
And this is what I set 

However, the problem is after 12mins (now is 15s), unless you physically press the blue button to terminate the experiment (looping the remaining text box), it will stay on the text block page, so my participants can not realise the time is up. Could someone help me with the code, so the experiment will auto-forward after 12mins? I am really new to java.
Many thanks
Question
How to let a looped block auto advance after certain time, but do not do it within the time limit.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
