0 votes
ago in SoSci Survey (English) by s328457 (110 points)

Overall goal
To investigate peoples preferences, I want to display four images of which they can always pick one. I want to do this 6 times per participant. Depending on a previous question i want to alter the selection pool for the images. In each selection pool itself there are two categories of pictures A and B. For the 6 pages, 2 should contain 1 A and 3 Bs, 2 should have 2 As and 2 Bs, and 2 will need 3 As and 1 B. In these pools all pictures should be shuffled and the order of the A and B combinations should also be randomized. No picture should be shown more than once. The Naming convention for the Pictures is 1.A_00. With the first number the pool, the second the category and the last one just a id. As data i need to know what the Full picture name was for each choice.

Problem
I am not able to adapt the pictures that are loaded into my questionare. I have tried to do all of it with php code but have not been able to. Another attempt to dynamically vary the name of the html tag image for each picture has also not been succesful.

Question
Does anyone have an idea how i could approach this problem in an elegant way?

ago by SoSci Survey (357k points)
How large yre the "selection pools" you're refering to? How many pools are there? And where does the previous selection come into play?
ago by s328457 (110 points)
The selection pools are 24-45 images each, with an almost equal split between Categories A and B. There are three pools and a question before decides which pool is choosen, that's where the previous selection comes into play.

1 Answer

0 votes
ago by SoSci Survey (357k points)

Okay, here's the outline. There are different ways to incorporate the pool, but as you need a lot of rotation, a random generator would be a good start.

You will need 6 random generators: One per pool and category (A/B). If I count correctly, you need 12 Images from each pool and each category (3+3+2+2+1+1). So, tell each random generator to draw 12 codes.

And you will need one seventh that decides which pages show which A/B-composition.

The, you'll need an IF filter to decide which pool to use, that is which pairs of random generators. Draw from these, and use valueList() to write the 24 drawn codes into 3 arrays. Now you have one array drawn from pool 1, category A, and one from pool 1, category B. That is, you have 2x12 images drawn.

Now comes the tricky part. From your seventh generator you know the combinations, for example you might have drawn...

AABB
ABBB
ABBB
AAAB
AABB
AAAB

I would leave the rotation per trial to the selection question. So, let's leave this order for now, and imagine to write all images one after the other, that is:

AABB ABBB ABBB...

Okay, now you need to count which image to use for which position. We start with A0 for the first A and B0 for the first B and count up:

A0 A1 B0 B1 - A2 B2 B3 B4 - A3 B5 B6 B7 - ...

As soon as you have this information, you're ready to go. Now you know that on page 1, you have to use the array A[0], A[0], B[0] and B[1] for the selection to display. Unnecessary to say that you should use a loopPage() to go through the 6 selections.

Huh, not easy, but you opted for some complex design, this is how you put it down in code. And don't dare and as ChatGPT how to do it in PHP, it will only mislead you. Just start with the first step, see how far you come, and tell when you're stuck.

Willkommen im Online-Support von SoSci Survey.

Hier bekommen Sie schnelle und fundierte Antworten von anderen Projektleitern und direkt von SoSci Survey.

→ Eine Frage stellen


Welcome to the SoSci Survey online support.

Simply ask a question to quickly get answers from other professionals, and directly from SoSci Survey.

→ Ask a Question

...