0 votes
in SoSci Survey (English) by s117924 (130 points)
edited by SoSci Survey

Dear all,

I am not able to correctly store data for each of randomized audio file. Perhaps I am missing something.
I would like to display audio filenames on 'View Data Set' Analysis.

if (! isset($ blocks)) {
    $ blocks = array( 
        array ('EX03', 'training1.mp3'),
        array ('EX07', 'training2.mp3'),
        array ('EX08', '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]);

Please, If you might help me.
I would be very very grateful.

Best for all of us

by SoSci Survey (328k points)
I assume that the answers to EX03/07/08 are available in the data set? EX03 always belongs to training1.mp3, etc.

Could you please specify what data you would like to store?
by s117924 (130 points)
YES!

EX03/07/08 are questions to be aswered by listening training1/training2/training3 audiofiles.

Respondent has to select one image (from multiple figures) for each listened sound.

Example: On 'View Data Set' tab, it gives me EX03 - 2; EX07 - 2; EX08 - 2
So, I can't visualize audio filename (e.g.: training2.mp3/EX07 - 2; training1.mp3/EX03 - 2; training3.mp3/EX08 - 2).

Seemingly, shuffle is not working properly (perhaps code is unclear)

Thank you for the answer!
by s117924 (130 points)
Another Issue relies on, I believe, function put(). If I do not save anything extra, then I will not be able to understand in the analysis in which order the audio files were shown.
But I can't stand where and how to put function put().

please, help me.

1 Answer

+1 vote
by SoSci Survey (328k points)

So, I can't visualize audio filename

Well, you can, but I do ot understand the point. What you already have is:

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

You can as well add the filename to the output.

<p>You now hear the audio file '.$blocks[$i][1].'</p>
<audio id="audio_with_controls" preload="auto" controls>
  <source src="'.$ blocks[$ i][1].'" " type="audio/mpeg"/>

function put(). If I do not save anything extra, then I will not be able to understand in the analysis in which order the audio files were shown.

Yes. Please take a look into the manual into the German (!) manual for put(). This contains some code samples at the end how to store a random order. If you have troubles applying this to your case, just create a new question here. And please also include the PHP code that you have written so far.

by s117924 (130 points)
Thank you so much for the answer. I did realize that it is possible to display filename using html.
Awesome!


I will try to do it because it will be the first time I will use put()..
Cheers
by SoSci Survey (328k points)
Alright :) Just in case, you are not yet using the debug mode, you may find this useful, as well: https://www.soscisurvey.de/help/doku.php/en:create:debugging

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

...