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!