problem in audio in quiz

problem in audio in quiz

by m question -
Number of replies: 3

Hi,

I faced problem in the quiz in moodle

there is audio that students must listen to and then answer MCQ

the audio added and then MCQ

however,

the control of the mp3 player is so difficult during the exam

when student scroll down, it stopped

some times the player start from beginning many times and not complete the audio

not all students faced this problem

is it moodle issue or is it connected to the internet or other issues

any help will appreciate it



Average of ratings: -
In reply to m question

Re: problem in audio in quiz

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello m,

Moodle automatically replaces the <audio> element with a player that does not seem to always work properly smileThis replacement is difficult to circumvent.

Using a custom player was the only way to play an audio file before HTML5, which was only recently introduced (late 2014). Nowadays, in an ordinary web page, the <audio> element triggers a built-in HTML5 audio player that works well in most browsers with MP3, WAV and OGG files.

You may need to consider a workaround. You could use another javascript plug-in that works for you. There are many available on the Internet. Even use YouTube, if you think it's not an overkill.

Note to developers: If possible, I think Moodle should now let the <audio> element just function as per HTML5.



Moodle audio player


HTML5 audio player


Average of ratings: Useful (1)
In reply to Dominique Bauer

Re: problem in audio in quiz

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

In fact, we can easily foil Moodle and display the HTML5 player with a simple script:

<div id="divId"></div>
<script>
    function functionPlayer() {
        var x = document.createElement("AUDIO");
        x.setAttribute("src", "https://xxxx/draftfile.php/5/user/draft/xxxx/audioFile.mp3");
        x.setAttribute("controls", "controls");
        document.getElementById("divId").appendChild(x);
    }
    window.onload = functionPlayer;
</script>

You will find an example here (where I will explain the code in the coming days):

ForumQuiz_20191023_0155.png?time=1571810365510
Average of ratings: Useful (2)
In reply to Dominique Bauer

Re: problem in audio in quiz

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

In fact, it's very easy to change the default audio player from VideoJS player (Moodle's default) to the HTML5 audio player:

  • Go to Site administration / Plugins / Multimedia plugins / Manage media players and move 'HTML5 audio' above 'VideoJS player'. See the screenshot below.

Note, however, that this change will apply to your entire Moodle site. If you want to keep VideoJS as the default player while using HTML5 audio in specific activities or resources, or if you do not have access to site administration, you can use the script I gave above.

Moodle 3.2 now comes with a default industry-leading media player - Video.js:

ForumQuiz_20191023_1652.png

Average of ratings: Useful (2)