Question
java code for "Display when CurrentLoopNumber is equal to 5"
Hi there,
Thanks for your attention.
I have 40 elements in my loop and merge, all randomized. I want my respondents to "rest"(answer some unrelated questions) after they finish 5 questions.
Ideally I think a command like "Display it when CurrentLoopNumber is equal to 5" can do. But I cannot use CurrentLoopNumber in the display logic. Maybe javascript can help? As I know little about Java, hope someone can help me here.
Thanks a lot!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.

Inspired by your answers, my logic to handle the problem is that:
- Hide the "rest" questions
- Display the "rest" questions when "${lm://CurrentLoopNumber}" == 4
So I tried:
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
if(parseInt("${lm://CurrentLoopNumber}") == 4) {
jQuery("#"+this.questionId).css("display", "block");
}
});
So I guess I need a CSS code to hide questions in loop and merge, and java code to display the question when CurrentLoopNumber is equal to 4. Is that appropriate? Looking forward to any comments and thanks for your help!