0 votes
in SoSci Survey (English) by s166545 (130 points)

Hello, dear support team,

I would like to make a survey that should include 16 different stimuli and one (same) question for each stimulus. I planned to use an embedded site for each stimulus. Each stimulus should be shown for a limited time (like 10s) and then be closed automatically. Moreover, it would be great if all stimuli could be shown in random order.

I did not find a similar situation like it so I would like to ask you here. There is a template I found called Selective Exposure Timing. However, this one seems not very suitable for me because it collects timing data that I do not really need and it is only for 1 stimulus as I understand.

Thanks for the help in advance.

Bests

by SoSci Survey (302k points)
> I planned to use an embedded site for each stimulus.

Could you go a bit in detail about that?

In general, embedding a site via <iframe> is not different from using an image as stimulus. But only as long as you do not need any information from the embedded page.
by s166545 (130 points)
edited by s166545
thanks for the quick response!

As for the website, I plan to build some simple static web pages, which include some texts, pictures, and animations. They are only for viewing as stimuli. But I did not work them out yet. Is it ok to use the iframe to reach these sites?

Moreover, if I randomize the order of these sites (stimulus), how can I know which answer belongs to which stimulus when I analyze data since the question is always the same?

Thanks again!

Best

1 Answer

0 votes
by SoSci Survey (302k points)

Is it ok to use the iframe to reach these sites?

You will have some limitations, specifically you may encounter responsiveness issues if someone is doing the survey on a mobile device.

Possibly, it may be a better solution to just use the HTML pages as questionnaire pages. You can simply use HTML code as questionnaire contents, and there is a "presenter" layout that can be used for single pages, having few elements on itself.

Each stimulus should be shown for a limited time (like 10s) and then be closed automatically.

Independently from the solution you choose for the pages to embed them. Timing should be easy to accomplish: Timer: Go Onto Next Page Automatically. You may only use a very short JavaScript for the timers, as you won't need all the PHP in your case:

<script type="text/javascript">
window.setTimeout(SoSciTools.submitPage, 10000);
</script>

Moreover, it would be great if all stimuli could be shown in random order.

Please follow this manual: Rotation of Question Blocks

You could do it more elegantly by using loopToPage(), but the "simple" version explained in that manual is more straight-forward.

by s166545 (130 points)
edited by SoSci Survey
Thanks for the response first!

I have 3 questions related to your answer:

1. As for the "HTML code as questionnaire contents", do you refer to the following  HTML code?

<a href="https://www.soscisurvey.de/">SoSci Survey Homepage</a>

In my case, I would like the site to be shown directly without needing to click it.

2. In my case, 16 different pages (stimuli) are all combined with one (same) question. Should I use the block rotation here since the question should be to together with each page? Is the following PHP code the right one I should use?

// First save the page labels as array
$rotation = array(
  'A' => array('A1','A2',),
  'B' => array('B1','B2',),
  'C' => array('C1','C2',),
  'D' => array('D1','D2',),
  'E' => array('E1','E2',),
);
// Mix each block individually
foreach ($rotation as $key => $pages) {
  // Remove the first page from the array $pages
  $first = array_shift($pages);
  // Mix the rest
  shuffle($pages);
  // Put the two back together again
  array_unshift($pages, $first);
  // And save back to the $rotation array
  $rotation[$key] = $pages;
}
 
// Now mix the order of the blocks randomly
shuffle($rotation);
 
// Now set the result as page sequence
// Continue with page 'Q' afterwards
setPageOrder($rotation, 'Q1');

3. In my case, the question after the stimulus is always the same, should I just copy them 16 times since I can not use the same one in the questionnaire?

Bests!
by SoSci Survey (302k points)
> As for the "HTML code as questionnaire contents", do you refer to the following  HTML code?

No, to the "Add Text" option in sections and the questionnaire layout. They together create the overall page HTML.

> In my case, 16 different pages (stimuli) are all combined with one (same) question.

You will need 16 copies of the question.

Regarding the PHP code: Does ist work?
by s166545 (130 points)
Thanks for the answer.

I also want to ask, if I add the HTML code into the "Add Text", should I also upload all pictures needed in that HTML code? Sorry for the noob questions, I really have little knowledge of all these.

As for the PHP code, I do not test it yet. I will do it after all stimuli could be shown.

Bests
by SoSci Survey (302k points)
To upload the images, please go to "Images and Media Files".

After uploading, you may have to embed them in your HTML code by using the <img> Tag.
by s166545 (130 points)
Hello,

the PHP code for block rotation does not work. Is it the right one I should use if I want to rotate different blocks (Each block contains 2 pages, one stimulus, and one question)? The questions within the block should not be shuffled.

// First save the page labels as array
$rotation = array(
  'A' => array('A1','A2'),
  'B' => array('B1','B2'),
  'C' => array('C1','C2'),
  'D' => array('D1','D2'),
  'E' => array('E1','E2'),
);
// Mix each block individually
foreach ($rotation as $key => $pages) {
  // Remove the first page from the array $pages
  $first = array_shift($pages);
  // Mix the rest
  // Put the two back together again
  array_unshift($pages, $first);
  // And save back to the $rotation array
  $rotation[$key] = $pages;
}
 
// Now mix the order of the blocks randomly
shuffle($rotation);
 
// Now set the result as page sequence
// Continue with page 'F1' afterwards
setPageOrder($rotation, F1');

Thanks!
by SoSci Survey (302k points)
There is a quotation mark missing in the last line, before F1. But, given that is not the problem, how does "not work" look like in your case?

Also, you may want to use this code that is more simply, but currently only printed in the German manual:

if (!isset($blocks)) {
  // Liste der Seiten definieren
  $blocks = array(
    // Block 1
    array('B1A', 'B1B', 'B1C'),
    // Block 2
    array('B2A', 'B2B', 'B2C', 'B2D'),
    // Block 3
    array('B3A', 'B3B')
  );
  // Jeden einzelnen Block in sich mischen
  for ($i=0; $i<count($blocks); $i++) {
    shuffle($blocks[$i]);
  }
  // Liste der Blöcke mischen
  shuffle($blocks);
  // Die Seite ergänzen, wo es nachher weiter geht
  $blocks[] = 'SD';
  // Reihenfolge zwischenspeichern, um spätere Änderung zu vermeiden
  registerVariable($blocks);
}
setPageOrder($blocks);
by s166545 (130 points)
Thanks for your answer. I used the code you shared. However, there are still 2 problems:

1. I want the questions within the block not to be rotated. The stimulus should always be shown first, and then the question. e.g., A1 first, then A2.

2. Once A1 is shown, it should directly go to A2 first before another rotation. With this code, however, it could be like A1→C1→A2, which is not what I want. The question should always be combined with the related stimulus.

Hier is the code you shared in my case:

if (!isset($blocks)) {
  // Liste der Seiten definieren
  $blocks = array(
    // Block 1
    array('A1', 'A2',),
    // Block 2
    array('B1', 'B2',),
    // Block 3
    array('C1', 'C2'),
    // Block 4
    array('D1', 'D2'),    
    // Block 5
    array('E1', 'E2'),    
    // Block 6
    array('F1', 'F2'),    
    // Block 7
    array('G1', 'G2'),
    // Block 8
    array('H1', 'H2'),
    // Block 9
    array('I1', 'I2'),
    // Block 10
    array('J1', 'J2'),
    // Block 11
    array('K1', 'K2'),
    // Block 12
    array('L1', 'L2'),
    // Block 13
    array('M1', 'M2'),
    // Block 14
    array('N1', 'N2'),
    // Block 15
    array('O1', 'O2'),
    // Block 16
    array('P1', 'P2'),
  );
  // Jeden einzelnen Block in sich mischen
  for ($i=0; $i<count($blocks); $i++) {
    shuffle($blocks[$i]);
  }
  // Liste der Blöcke mischen
  shuffle($blocks);
  // Die Seite ergänzen, wo es nachher weiter geht
  $blocks[] = 'Q1';
  // Reihenfolge zwischenspeichern, um spätere Änderung zu vermeiden
  registerVariable($blocks);
}
setPageOrder($blocks);
by SoSci Survey (302k points)
>  I want the questions within the block not to be rotated.

That makes the code even easier :) Leave this part out:

  // Jeden einzelnen Block in sich mischen
  for ($i=0; $i<count($blocks); $i++) {
    shuffle($blocks[$i]);
  }

> With this code, however, it could be like A1→C1→A2, which is not what I want.

I am quite convinced that this was not even possibly with the above code (that is to be removed). The code was explicitly created to have the pages within a block stick to one another.
by s166545 (130 points)
thanks for the answer. I solved the first problem by removing the code.

However, I still have the second problem. More precisely, sometimes the question would just be skipped so that two stimuli show without a question in between. Since all the questions are the same, I am not sure if the order is A1→C1→A2 or A1→C1→C2, or A1→C1→D2. But what I am sure of is that A2 was missing.

Thanks!
by SoSci Survey (302k points)
Have you tried starting the questionnaire in debug mode (yellow button)? You will see the page order in the debug information, and you will see the codes of the pages and questions.
by s166545 (130 points)
When I run the questionnaire again, the problem is gone, I don't know why actually.

Here I have another question regarding a warning:
 
Please note that the random values created via random() or shuffle() will not automatically be stored in the data set. If necessary, you may use put() to store them.

Can you explain shortly what random values are? And if I need to store them, where should I put () exactly?

Thanks!
by SoSci Survey (302k points)
> Can you explain shortly what random values are?

What this warning tells you: You won't be able to see the order in which the pages (blocks) have been shown, in your dataset.

If you need their order for analyses, you will need additional code. Or you may also use a random generator instead the PHP code with shuffle().

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

...