• Resolved rolandksmith

    (@rolandksmith)


    I’m working on a page to be used for evaluation of a student’s Morse code capability. I’d like to present an audio file that the student can play only once and not be able to download the file. After playing the audio segment, the student would answer some questions.

    Any suggestions on how this might be accomplished? I’m open to just about any option.

    Thanks!

    • This topic was modified 2 years, 9 months ago by Jan Dembowski.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi Roland,

    I took your question as an opportunity and wrote a small plugin for it. Thanks to the support of the plugin repository maintainers, it is now already in the WordPress repository and can be used. You can find it here: https://www.ads-software.com/plugins/play-audio-once/

    The plugin adds an option to the audio block in Gutenberg to restrict playback. If activated, you can play the audio file only once. Repeated playback as well as jumping to a position in the playback are not possible.

    Please note that this can only be used if JavaScript is activated in the visitor’s browser. Without JavaScript, this blocking is technically not possible. It is also technically not possible to block the download of the file, but you have to be technically proficient to do so.

    Even if you don’t use it, I see it as a nice exercise for me. Thanks for the suggestion.

    Thread Starter rolandksmith

    (@rolandksmith)

    Wow!! This is a beautiful plugin!! It does exactly what I need to have happen. I think anyone who is using WordPress in a teaching situation would have need for this plugin. Thanks again!

    Thread Starter rolandksmith

    (@rolandksmith)

    We’ve been using the plugin for a month now and it’s working incredibly well about 95% of the time. When the student plays an audio clip and answers appropriately, the student has the option of playing a clip from the next higher level and answering that clip. Occasionally the next higher level clip won’t play even though the program verifies that the student hasn’t heard that clip before. If the student refreshes the page, a new unplayed clip is served up and most of they time will play.

    Since the student can go away and come back later, the session variable goes away. Consequently, each time the student plays a clip, that information is stored in a database table and the program makes sure that same clip is never served up again.

    This problem only happens while in the same session. Is it possible that the MD5 hash is returning duplicate hashes?

    The audio clips are named like this:
    https://cwa.cwops.org/wp-content/uploads/begbas10.mp3 where the base file name (begbas10) is the only thing that changes from clip to clip. They are all named
    begbasnn
    basintnn
    intadvnn

    and there are about 80 files for each category.

    Thanks!
    Roland

    Glad to hear it’s working so well. However, I cannot reproduce the described problem in my own test. The md5 hashes are very unique since they also include the filename. If it is different, the md5 hash is also different. Therefore I cannot judge this more exactly.

    Please use the (currently empty) support forum of the plugin for future inquiries, I would also see it faster there: https://www.ads-software.com/support/plugin/play-audio-once/

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Play Audio File Once Only’ is closed to new replies.