Multiple Choice Button to Play Hidden Audio | XM Community
Skip to main content

hello, 

 

I would like to have a multiple-choice option play a hidden audio file. Does anyone know how to do that? I know how to hide the audio but don’t know how to have the selection of the choice trigger the audio to play. 

 

Thank you! 

Hi @AnnaM89 ,

 

I think you can refer to this video link on how to hide and play around with audio file. 

Instead of Image click, just change the javascript code to “label” or “id” on which you want to play audio.

Hope this helps.

 

Thanks,

JB   


Thank you for this! Having a click on an image to trigger would be fine. However, I am getting an error with the code suggested in the video: 

 

Qualtrics.SurveyEngine.addOnload(function()
{
    
});

Qualtrics.SurveyEngine.addOnReady(function(){
    
    jQuery(".img").on('click',function)(){
        
        jQuery('audio').trigger("play");
        
    });
    
});

Qualtrics.SurveyEngine.addOnUnload(function()
                                   {
    
});

 

Can you see anything wrong with it? Sorry - I am not very familiar with javascritpt. 

 

Thanks again! 


Hello again, 

 

I was able to get this working. However, when I have multiple audio files - it plays all of them. How can I specify it to only play one per image? 

 

Thanks!


Leave a Reply