Using unique page timer for randomized questions? | XM Community
Solved

Using unique page timer for randomized questions?

  • 3 November 2018
  • 1 reply
  • 11 views

I have a survey that involves showing participants images for a certain number of seconds. Each image should be shown for a unique amount of time, e.g. image1 for 2 seconds, image2 for 5 seconds, image3 for 1 second. I want each page to show only one image and I want to randomize the order of images.

I tried using the setTimeout function, but when I add page breaks and randomize the questions it only shows one image in my block. How would I fix this, or do it differently to make it work?
icon

Best answer by TomG 4 November 2018, 15:12

View original

1 reply

Userlevel 7
Badge +27
You can use a loop & merge block with the image urls and timeouts as loop & merge fields. Pipe the url field into a src attribute in an html img tag. Pipe the timeout field into your JavaScript. Randomize the loop.

Leave a Reply