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

Dear all,

Going further from previous doubts, I would like to store data retrieved by random questions when respondents answer one single question about sound stimulus.
Respondents You will assign a single visual shape to each of auditory stimulus that best represent it.

Figure Session was created with "Selection" Question Type and it was defined as 'Shuffle/rotate randmly' order

So far so good.

The PHP code to organize, shuffle and to present blocks randomly:

if (!isset($blocks)) {
$blocks = array(  
    array('EX07', 'training1.mp3'),
    array('EX08', 'training2.mp3'),
    array('EX09', 'training3.mp3'),
);
shuffle($blocks);
registerVariable($blocks);
}

$i = loopPage(count($blocks));

html('
<audio id="audio_with_controls" preload="auto" controls>
<source src="'.$blocks[$i][1].'" " type="audio/mpeg"/>
</audio>
<br />
<br />
');

question($blocks[$i][0]);
for ($i = 0; $i <count($blocks); $i ++) { 
  // create ID of internal variable from query identifier plus index 
    $id = id('EX', $blocks[$i][0]); 
  // save here the value from the array 
  put($id, $i +  1); 
}

Where 'EX07, EX08' and 'EX09' are the questions for each audio training (training1.mp3, training2.mp3, training3.mp3)

So I can't store the respondent's selection for each of random question

I am studying function put() from here but with no success
Could you please save my world?

Best!

in SoSci Survey (English) by s117924 (130 points)

1 Answer

+1 vote

So I can't store the respondent's selection for each of random question

Yes, you can :)

EX07 will always (!) store the response for training1.mp3,
EX08 willö always store the selectino for training2.mp3.

If that is what you needed, well ... you're already done.

What you do not yet have in the data is the order in which the stimuli were presented. This could be relevant, if you're about to analyze presentation order effects on response bahavior. If you need that (?) then please let me know.

by SoSci Survey (250k points)
Thank you for the answer!!!!!!!

    This could be relevant, if you're about to analyze presentation order effects on response bahavior

YES, please!

We do need to know the order in which the stimuli were presented.

Thank you for while!
Alright, then have a little modification for your initial block:

if (!isset($blocks)) {
  $options = array(  
    1 => array('EX07', 'training1.mp3'),
    2 => array('EX08', 'training2.mp3'),
    3 => array('EX09', 'training3.mp3'),
  );
  $keys = array_keys($blocks);
  shuffle($keys);
  $blocks = array();
  foreach ($keys as $i => $key) {
    put(id('IV01', $key), $i+1);
    blocks[] = $options[$key];
  }
  registerVariable($blocks);
}

You need a question "internal variables" with 3 variables and the ID IV01 for this code to work. This will then store the rank order of the options. That means: IV01_01 tells you on which position the training1.mp3 was shown.
Awesome!

Very perceptive!
I have just updated my script

Thank you a lot!

Cheers!
...