Hello!
I’m working on a survey where users input a participant ID, and I’d like for Image A to be displayed for users with an even ID and Image B to be displayed for users with an odd ID. It doesn’t matter to me whether the images are on a new page/in a new block, so long as they are able to continue on with the rest of the survey after seeing the image.
My issue: Every time I preview the survey, it goes directly from the ID question to the Passcode block, skipping over the two blocks (2 and 3) I currently have for the images.
Here’s my JavaScript on the Participant ID question:
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
});
Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/
// Get the value of the numeric input
var userInput = "${q://QID52/ChoiceTextEntryValue}";
var num_id = parseInt(userInput, 10);
if (num_id % 2 == 0) {
// If even, set a new embedded data variable to "even"
Qualtrics.SurveyEngine.setEmbeddedData("ppt_id", "even");
} else {
// If odd, set a new embedded data variable to "odd"
Qualtrics.SurveyEngine.setEmPPbeddedData("ppt_id", "odd");
}
});
Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/
})
And below is my current survey flow:

I have also tried not setting a specific value for ppt_id in the survey flow, changing the order of the blocks, and other such variations. I don’t want to have to write conditionals for every possible ID, and was wondering if there’s an easier way to do this.
Thank you!