0 votes
in SoSci Survey (English) by s172445 (200 points)

Hello,

I have a question regarding image randomization.

In my questionnaire, participants are asked to rank a number of randomized images. There is one image per page with two questions attached under it. The questions are the same for every image. Each image should only be shown once to each participant. I also want to break up the image pages with another page after every nine image pages, asking the participant if they'd like to rate another set of 9 images or go to the end of the questionnaire. The page order should look like this: 9 pages with one random image on each > "continue?" page > 9 pages with one random image on each > "continue?" page > 9 pages with one random image on each and so forth until all images have been rated. When I try to achieve this, the same 9 images are shown in each "section" of images (the 9 images differ between participants, so the randomization is at least working partly). This is what I've done:

First, I created a random generator. All images have been entered in the "code" column, and all images have received a corresponding code. The number of codes drawn per interview is the same number as the total number of images. "Type of drawing" is set to "equally distributed". This seems to be working, as the "drawn yet" column shows that each code is drawn once per interview. All the variables look fine.

I've then added the random generator to each image page (I suspect this is where the problem comes from), and looped each page 9 times. The page order in "compose questionnaire" looks like this: image page > "continue?" page > image page > "continue?" page > image page (and so on). Each image page also has PHP code based on this template:

  // loopPage(20) provides a number between 0 and 19 (plus one at every repetition)
    $i = loopPage(20);  // Here you can enter the number of images you want to show
    // Show the chosen picture
    $varID = 'ZG03x'.sprintf('%02d', $i + 1);  // Variable IDs are ZG03x01 to ZG03x20
    $img = value($varID, 'label');
    // The HTML-Tag <img> shows one image, the filename will be shown with src 
    html('
      <div style="margin: 3em; text-align: center">
        <img src="'.$img.'" alt="" />
      </div>
    ');
    // Create the fitting question ID and show the question using question()
    question(id('AB', $i + 1)); // Question IDs AB01 to AB20

There are 2x9 question ID:s for every page, and the referenced sections are different for every page (but the actual questions are identical).

What should I do to fix the problem, and make sure each image is only shown once per participant but still randomized and regularly intercepted with a "continue?"-page? If I make several identical random generators there is a risk that the same image will be shown more than once to a single participant. If I divide the total number of images between several random generators, the 9-image sections would still be in the same order for all participants, even if the order of the 9 images within the sections would be randomized. Is there a way to randomize the order of the sections as well? That would mitigate the problem.

I don't have experience with any kind of code, so very clear answers would be much appreciated!

1 Answer

0 votes
by SoSci Survey (302k points)

Firt, it is important to have the responses for image 1 in the same variables in every interviews, no matter at which position the image is displayed. Everything else ends in analysis hell. Or ...

The page order should look like this: 9 pages with one random image on each > "continue?" page > 9 pages with one random image on each > "continue?" page > 9 pages with one random image on each

How many images do you have overall? If it's more than a dozend, I would strongly recommend to use a multi-level structure here. This will also easy the 9-page-blocks a lot.

What would be good solution in my opinion: Create a master-questionnaire with a random generator that will draw all (!) images per interview. The number of images is also the limit of repetitions.

Then use valueList() and array_chunk() to get the list of images (or their codes) and split them in blocks of 9. Then insert a -1 between the blocks. This is a proper signal for the sub-questionnaire to display the choice question. Another option would be to create 9 pages in the sub-questionnaire, but that would complicate the data structure, compared to a one-image sub-questionnaire.

Try with the manual about the multi-level structure. You will probably want to work with randomUse() as well to receive the same number of rating for each image. But that is something we can clarify in another question, here in the online support.

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

...