How to restrict the number of times participants can play audio

joyhuijskensjoyhuijskens AmsterdamCommunity Member Qubie ✭

How to restrict the number of times participants can play audio

Hello all!
Does anyone know how to restrict the number of times participants can play audio attached to a question?
I would like my participants to hear each fragment only once. However, I do not want to remove the play button and let the sound autoplay, because they should have some time to read the question before they play the sound fragment.
I hope to hear from someone! Thanks in advance :)
Joy

Best Answers

  • [Deleted User][Deleted User] Qubie ✭
    Accepted Answer

    Hello @joyhuijskens ,

    Paste the following code in the js(onReady) of the question

        jQuery('audio').on('ended', function() {
            jQuery(this).css("pointer-events","none");
    });
    
  • emilymemilym Qubie ✭
    Accepted Answer

    Hi Joy,

    I'm working on a similar problem. You can also modify Shashi's code a bit to hide the media player instead of disabling clicking, which might be more comfortable for your users:
    jQuery('audio').on('ended', function() { jQuery(this).hide(); });

  • [Deleted User][Deleted User] Qubie ✭
    edited October 2018 Accepted Answer

    @joyhuijskens said:
    Thank you both for your replies! I will try to make this work:) Unfortunatly I am very inexperienced in programming - so I nee da little more information. Where exactly do I paste this in..? In the htmltext of each question.. and then in what line? Or where can i open the java script?
    I am curious to hear from you!

    Follow this page to add the code in each page
    Put in OnReady function

Answers

  • joyhuijskensjoyhuijskens AmsterdamCommunity Member Qubie ✭

    Thank you both for your replies! I will try to make this work:) Unfortunatly I am very inexperienced in programming - so I nee da little more information. Where exactly do I paste this in..? In the htmltext of each question.. and then in what line? Or where can i open the java script?
    I am curious to hear from you!

Sign In to Comment