Solved
How to write code to randomly display photos, meeting the given conditions
Hi, I got 80 pictures split in 2 groups ( groups 1 and 2 ) which are also split in 10 categories from "a" to "j" ( each category contain 4 pictures ).
I need to randomly show 40 pictures, 20 pictures from group 1 and 20 pictures from group 2. Whats important is if picture number 1 from category "a" is showed i also need to show remaining 3 pictures from category "a". So basically i need to randomly display pictures from each 5 categories from grup 1 and group 2. The more randomized display of pictures is then beter. I also need to set time limit for display ( 4 s ) for each picture. Have anyone done something similar before? I am open for any ideas.
Best answer by Anonymous
> @Laura_Kulak said:
> > @Shashi said:
> > Hello @Laura_Kulak ,
> >
> > Also you can create 20 blocks each containing 4 questions.
> > Apply Randomize advanced element to 10 blocks i.e to group 1 and set randomly present 5 blocks i.e the respondent will see 20 questions(pictures) in the survey from first randomizer
> > Similarly, set Randomize advanced element for next 10 blocks i.e for group 2.
> > Apply auto advance to every question, so that respondent can only see picture for 4 seconds
>
> I did it that way already, but it is not randomized enough for my supervisor.
> They want me to make it work like that:
>
> 1. Select 5 categories from group 1 (20 pictures)
> 2. Select 5 categories from group 2 (another 20 pictures)
> 3. Display those 40 pictutres (20 from group 1 20 from group 2) complitly random
> 4. Each respondee should see different combination of pictures from different categories.
> Points 1 and 2 should also be randomized.
The JS solution will work according to your requirement then.
But if you want those 40 picture question to completely randomize then please note that Timer question for auto advance will not work instead use js for auto advance as below
You can put js(onready) in each question:
`setTimeout(function () {jQuery('#NextButton').click();},4000);`
View originalLeave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.