Moving to following questions automatically/playing sound | XM Community
Solved

Moving to following questions automatically/playing sound

  • 30 June 2018
  • 2 replies
  • 142 views

I am developing an experiment for academic purposes. I have to questions.

1) I want to set automatic auto-advance, which I found out how to on this link.
I added the following code to the “Edit Java Script Question” box. Now I would like to make “forward” button disappear. Would any ne be able to tell me how to do so?

Qualtrics.SurveyEngine.addOnload(function()
{
var that = this;
this.questionclick = function(event,element){
if (element.type == 'radio') {
that.clickNextButton();
}
}
});

2) I would also like a sound to be played as soon as the page is loaded. I did so by adding the following line inside my "Qualtrics.SurveyEngine.addOnload"

document.getElementById("1_2_3").play();

I also added the following in the HTML view of the question:

<audio>
<audio id="1_2_3" src="the_link_to_my_audio_file_in_qualtrics_library">
</audio>

However, when I preview the question, there is a weird echo. It seems that that file is being played twice! How can I fix this?
icon

Best answer by TomG 30 June 2018, 14:21

View original

2 replies

Userlevel 7
Badge +27
It is because you are in preview mode. It will play once for each frame (desktop and mobile). The echo will go away you are no longer in preview mode.

If it really bothers you, you can use JavaScript to look for 'preview' in the url, then find the audio in the mobile frame and mute it.
Is it possible the javascript for playing audio automatically on load is not working anymore? I found answers to similar questions from November and September and none of them are working for me.

I am looking for a way to play the audio file as soon as the slide is loaded (without requiring individuals to click on play).

Leave a Reply