My survey includes audio clips that I want the user to be able to play at most 3 times. | XM Community
Solved

My survey includes audio clips that I want the user to be able to play at most 3 times.

  • 23 July 2020
  • 1 reply
  • 28 views

The only option I have seen so far is to restrict them to play it only once or to have autoplay. Any ideas on how to achieve this?

icon

Best answer by amk960 23 July 2020, 18:13

View original

1 reply

Nevermind!! Solved it...
Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/
var counter=2;
jQuery('audio').on('ended', function() { 
if (counter==0){
jQuery(this).hide(); 
} else {counter--;}
});

});

--Added this in the add javascript option of the question.

Leave a Reply