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

0 votes

I am getting lost with all the randomization options and would appreciate anyone's help to simplify what I want to do.

I would like to present 90 images to participants using the selection sequence (one image per page with an associated question; same question for all images), divided in 4 blocks (25 images, 25, 20, 20). A single question is asked in-between the blocks. I need for the images to be randomly presented to participants (which are not divided in groups according to demographics or else; I want a true randomization), and for participants to see all of the 90 images.

Hence, I would need an option allowing for randomization/rotation of the images within a questionnaire for a participants, but also need the blocks to be linked to one another as I don't want the participant to see the same image twice.

Many thanks!

in SoSci Survey (English) by s219203 (165 points)
What effect do the blocks have? Do you want to keep the images from a block together? Or do you just want to shuffle all 90 images? You comment about "I want a true randomization" makes me suspicious in that aspect :)
Thank you for your follow-up questions!

Ultimately, yes I want to shuffle all 90 images per participant. Since this is a lot for them to see at once, I need some little breaks so that participants maintain their attention. As such, in-between blocks, I ask bogus question (e.g., I was born on planet Earth: true or false), and then the images resume.

I previously had my survey on Qualtrics and I achieved this within their "survey flow" function. I used a "randomizer" to select 25 images to show amongst the 90 in the first block, then add a "display branching function" to each image in the second block. That way, the randomizer in the second block only picked images that weren't previously shown to the participant in block 1. Blocks 3 and 4 had the same display branching function so that in the end, the participant had seen the 90 images but in a random order ACROSS the 4 blocks.

1 Answer

0 votes

I want to shuffle all 90 images per participant. Since this is a lot for them to see at once, I need some little breaks so that participants maintain their attention.

Okay, so the blocks are just for presentation. That means you can shuffle all images, and then you want to present them in blocks.

Honestly, you should consider to show only 30 images per person to keep data quality up. But I am sure, you already did and have good reasons.

So, in SoSci Survey one option would be to create a random generator with all 90 images (for example their filenames) in it. And then you tell it to draw 90 codes per interview (or less, if you have mercy with your respondents).

So, if your random generator has the name RG01, this would be a simple code to display the forst 25 images drawn.

$images = array_values(valueList('RG01', null, 'label'));
$block = array_slice($images, 0, 25);
$image = loopPage($block);
html('<div><img src="'.$image.'"></div>');

Get started with that and then let's narrow down what you need.

by SoSci Survey (233k points)
Indeed, I have no mercy for my future participants! Haha! Unfortunately, the study is part of a bigger project and I need to keep the same design as was previously done.

For the random generator to draw the 90 images:
1) Since my images are part of subquestions within a selection sequence question, should I put the filenames or subquestions' ID as codes in the ballot?
2) Where should I put this random generator?

For the PHP code to draw images/subquestions per block:
1) Would the code you suggest be complete as is or should I modify the name of an element in it?
2) Where should I put this PHP code? As an element in the questionnaire only (aka NOT as a question within the block or as a separate section in the "list of questions")?

Many thanks!
> should I put the filenames or subquestions' ID as codes in the ballot?

In that case, please simply use the IDs, i.e., 1, 2, 3, ... 90

> Where should I put this random generator?

Somewhere before the first block or on the page with the first block.

> Would the code you suggest be complete

No, not if you're using a selection sequence. In that case the code would be a bit different:

$items = array_values(valueList('RG01'));
$block = array_slice($items, 0, 25);
question('SQ01', $block);

> Where should I put this PHP code?

Wherever you want to display your first block's question. Instead the selection sequence question.
Ok! Looks like we've got one block working! One little thing is that the selection sequence question text lingers after the 25th image is shown. Anyway we can have it more smoothly transition to the next page?

Now, how do I create the other blocks so that the random generator remembers which image was already shown?

Here's my questionnaire's structure so far:
Page 1 = intro
Page 2 = random generator (RG01)
Page 3 = PHP code (I changed SQ01 for IT03)
Page 4 = break question 1
Page 5 = PHP code
Page 6 = end
*IT03 being only in the list of questions, not in the questionnaire.

Page 5 shows a notice: "One or more variables (IT03_02, IT03_02a, IT03_88, IT03_88a, ...) have already been asked on page 3...." and then promptly moves to page 6.
> One little thing is that the selection sequence question text lingers after the 25th image is shown.

Is that the last one?

> Anyway we can have it more smoothly transition to the next page?

Do display some text after the last subquestion?

> Page 5 shows a notice: "One or more variables (IT03_02, IT03_02a, IT03_88, IT03_88a, ...) have already been asked on page 3...." and then promptly moves to page 6.

You are sure that you used a different slice of the array for both parts? That is for the second part:

$block = array_slice($images, 25);  // no 0 as second parameter
Yes, the glitch happens after the last image of the block, so the 25th for the first block. Text is shown during the glitch. It is the selection sequence question's title. I could move it to the sub-question's title instead, if you think it might help? It was just easier as the question's title, since it's the same text for all trials. What follows the first block of 25 images is a multiple choice question ("break question").

I did not use a different code at first. I tried your advice and change the code (PHP on page 5) to:
$items = array_values(valueList('RG01'));
$block = array_slice($items, 25);
question('IT03', $block);

There is no more notice, but all of the 90 images appear randomly (instead of another set of 25 images for that second block).
>  the glitch happens after the last image of the block

Do I uderstand the glitch correctly?

* The last subquestion (in this block) is answered
* The title remains visible, but it takes a second before the next page appears

> There is no more notice, but all of the 90 images appear randomly

The code array_slice($items, 25) means: Anything as of index 25 (=image 26). If you want to show another 25, please use array_slice($items, 25, 25), see https://www.php.net/manual/en/function.array-slice.php

The next one then is array_slice($items, 50, 25), apparently ;)
>> Do I understand the glitch correctly?

Yes. The title remains visible for a second, and the options appear as "please wait" or something like that. I would like for the text of the break question to appear right after the last subquestion is answered, not a second after the title.

>> use array_slice($items, 25, 25)

It works!
I changed the 3rd and 4th PHP codes so that the blocks show 20 images. That way, all 90 images appear at some point throughout the questionnaire (25+25+20+20=90).  

Page 1 = intro
Page 2 = random generator (RG01)
Page 3 = PHP code $block = array_slice($items, 0, 25);
Page 4 = break question 1
Page 5 = PHP code $block = array_slice($items, 25, 25);
Page 6 = break question 2
Page 7 = PHP code $block = array_slice($items, 50, 20);
Page 8 = break question 3
Page 9 = PHP code $block = array_slice($items, 70, 20);
Page 10 = break question 4
Page 11 = end

Now, any way the break questions could also be randomized per interview (i.e., showing 1 out of 4 for pages 4, 6, 8, and 10)? I would guess it needs a random generator + a PHP code. What would be the code? It's not a selection sequence and the questions (BO01...BO04 of the section BO) aren't split as "subquestions of IT03" (like the images in pages 3, 5, 7, and 9 were...)...

One more thing: Any way the progress bar could reflect the actual progress of the participant? For now, it is stuck at 25% for all of block 1, then suddenly moves and stays flat again during block 2, etc. I previously figured out a code (XX) in Qualtrics to show a text element ("Image XX of 90") that would count the number of presented elements (i.e., IT03_01..._99) so far. Would SoSci be able to do such a thing?
>  I would like for the text of the break question to appear right after the last subquestion is answered, not a second after the title.

Well, the questionnaire must send the results back to the server, and wait for its answer. This is why the "please wait" appears. If you want to avoid this loading time, then you would have to work with JavaScript, having both questions on the same page, and taking care that one question is hidden when the other is displayed. What we can optimize is hiding the title/explanation when the "please wait" appears. Would that help?

> Any way the progress bar could reflect the actual progress of the participant?

If you like to work with JavaScript, you can use the SoSciTools.progress instance (see https://www.soscisurvey.de/help/doku.php/de:create:soscitools) and move the bar during the task. But it's not yet implemented by default for this question.
>> What we can optimize is hiding the title/explanation when the "please wait" appears. Would that help?

Yes! I'm guessing I can achieve that by leaving the "question" title empty and moving the text to the "subquestion" title instead? Any easier way (as I'll have to manually copy-paste the question into each subquestion)?



>> Progress bar

If JavaScript could work, I'll try it! I'm fairly new using it however. Reading through the link you sent, I could figure out this bit:

<script type="text/javascript">
<!--

SoSciTools.progress();

setWithinPage();

// -->
</script>

I'm not sure what to add more to the code, or where to put it. Any help appreciated!

Alternatively, as I previously mentioned, (when my survey was with Qualtrics) I had internal variables acting as a simple counter. The "counter" was equal to a value of 0 at first (in the questionnaire structure), then other internal variables (i.e., $e{ e://Field/Counter + 1 }) were paired with each subquestions/images. In text (on the same page as the image), I then displayed "Image ${e://Field/Counter} of 90", and the code was changed to the number of images shown so far in the questionnaire. Would SoSci be able to handle a similar code?



>> Any advice for randomizing the break questions as well? I've copy-paste my question again for context.

"Now, any way the break questions could also be randomized per interview (i.e., showing 1 out of 4 for pages 4, 6, 8, and 10)? I would guess it needs a random generator + a PHP code. What would be the codes? It's not a selection sequence and the questions (BO01...BO04 of the section BO) aren't split as "subquestions of IT03" (like the images in pages 3, 5, 7, and 9 were...)..."

I created another random generator, with numbers from 1 to 4 (i.e., RG02). Then, I placed a PHP code (see below) on the questionnaire page with RG02. I keep having the error message "Variable RG02 is unknown to this project (see listing of variables). Therefore no result can be retrieved." Any advice?

$number = value('RG02');
 
if ($number == 1) {
  question('BO01');
} elseif ($number == 2) {
  question('BO01');
} elseif ($number == 3) {
  question('BO02');
} elseif ($number == 4) {
  question('BO02');
}
Alright - we installed an update on www.soscisurvey.de that makes the selection sequence to hide the "question" when the "please wait" message is displayed. Also does the progress bar now move with the sub-questions.

> Variable RG02 is unknown to this project (see listing of variables)

(if this question is still relevant)

Could it be that you told the random generator to draw more than one code per interview? Please check the "variables" tab in the random generator for more information on the variables.
...