Audio player is visible but audio does not work in student quiz in 3.0

Re: Audio player is visible but audio does not work in student quiz in 3.0

by Matthias Giger -
Number of replies: 1
Picture of Particularly helpful Moodlers

Dear Marcus

The version I'm using is 3.1.7. And the problem appears only with the Word select question type regardless where you use it (student quiz or normal quiz) - so it is not actually linked to the student quiz.

The code which is generated looks like this:

<audio controls="true"  class="mediaplugin mediaplugin_html5audio" preload="none" title="audio">
<source src="https://mymoodlepath/pluginfile.php/6580/qtype_wordselect/introduction/156/1/10207/sound.mp3" type="audio/mp3"></source>
<audio controls="true"  class="mediaplugin mediaplugin_html5audio" preload="none" title="sound.mp3">
<source src="https://mymoodlepath/pluginfile.php/6580/qtype_wordselect/introduction/156/1/10207/sound.mp3" type="audio/mp3"></source>

<a class="mediafallbacklink" href="https://mymoodlepath/pluginfile.php/6580/qtype_wordselect/introduction/156/1/10207/sound.mp3">sound.mp3</a>
</audio>

In contrast, the code generated when using the gapfill question type looks like this.

<audio controls="true"  class="mediaplugin mediaplugin_html5audio" preload="none" title="audio">
<source src="https://mymoodlepath/pluginfile.php/6580/question/questiontext/155/1/10206/sound.mp3" type="audio/mp3"></source>
<a class="mediafallbacklink" href="https://mymoodlepath/pluginfile.php/6580/question/questiontext/155/1/10206/sound.mp3">sound.mp3</a>
</audio>

It looks as on my installation the wordselect question type is generating repetitive code.


I tried the same with a local Moodle 3.0 installation. The code generated their is slightly different, but the results are the same with the wordselect question type: The player shows, once you press it, is goes gray and no audio is played.

When the pages loads, the player looks the way is should:

Player when page loads

One you click on play, it doesn't work:

Player once play is pressed

I also tried the same in a Moodle 3.3.1 installation (I don't have a 3.2 installation). With slightly different setting Moodle shows an error message: "The media couldn't be loaded ...". The code looks different, but the results are the same. The audio file doesn't play.

In short:

  • The problem only occurs with the word select question type.
  • The problem consists across 3 different installations (Moodle 3.0, 3.1, 3.3 all on different servers, 2 different installations on a web hosting service, one a bitnami local installation).

Hopefully any of these is helpful.

Matthias

In reply to Matthias Giger

Re: Audio player is visible but audio does not work in student quiz in 3.0

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

I have released version 1.1 of the Wordselect question type that addresses this issue. 

https://moodle.org/plugins/qtype_wordselect

Here is the new entry into the releasenotes.md file 


Version 1.1 of the Moodle WordSelect question type by Marcus Green. July 2017

Fixed a bug that prevented audio files working correctly in the question text. Thanks to Matthias Giger for reporting this. Fixed an issue that prevented any files being inserted into the introduction area. Improved phpdoc of the source code.