Problem with Flash audio player in the HotPot module

Problem with Flash audio player in the HotPot module

by Josep M. Fontana -
Number of replies: 10
Hi Gordon (or anyone else listening smile)

It seems that the HotPot module (or Moodle) won't let a Flash audio player play audio properly when inserted in a Hot Potatoes exercise.

I've created the following exercise which you can see in the following URL:

http://sindarin.upf.es/~jfontana/The_triumph_of_the_amateurs/The_triumph_of_the_amateurs_1.htm

As you can observe, there is a visible play button in the Flash audio player. If you click it, you will be able to listen to the audio recording.

If I create a HotPot activity using exactly the same files, the player shows the pause button instead of the play button and there is no way to listen to the audio recording.

Gordon, in case you need to get in the course, you are still a teacher there. I've mailed you the login and password in case you forgot.

http://parles.upf.es/moodle/mod/hotpot/view.php?id=1184

I will appreciate any help anybody can offer. Being able to use a Flash player is a must for me.

Josep M.
Average of ratings: -
In reply to Josep M. Fontana

Re: Problem with Flash audio player in the HotPot module

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Hi Josep,
I have modified the HotPot module to correctly adjust the relative URLs in the media player you are using. You can download the updated module tomorrow from the Moodle downloads page, or you can use the attached zip file for "mod/hotpot/lib.php".

Since you are a curious fellow smile, you will want to know why your media player did not work. The answer is that the relative URL for the sound file was not being converted to an absolute URL. The reason for that is because the sound file was specified using a setting called "file", as in the following <PARAM> tag
<param name="FlashVars" value="file=amateurs.mp3&amp;autolaunch=false&amp;my_BackgroundColor=0xeeeeee" />
The HotPot module had been trained to look for the "src" and "TheSound", but not "file". To fix the problem, I simply added "file" to the list of settings to be converted in the <PARAM> tags.

all the best
Gordon
In reply to Gordon Bateson

Re: Problem with Flash audio player in the HotPot module

by seaghan moriarty -

Hi Gordon,

just a quick note to say that your amazing help is being helpful to many other 'lurkers' like myself and very much appreciated - thanks smile

In reply to seaghan moriarty

Re: Problem with Flash audio player in the HotPot module

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Hi Seaghan,
thanks for speaking up in such kind words. It's good to know you're there and appreciate the HotPot module approve

As always, please don't hesitate to say if you have suggestions for improvements or have a quiz that behaves unexpectedly.

all the best
Gordon
In reply to Gordon Bateson

Re: Problem with Flash audio player in the HotPot module

by Art Lader -
I have to chime in here, too, Gordon. You have made and continue to make a huge contribution to Moodle. Thank you so much!

-- Art
In reply to Gordon Bateson

Re: Problem with Flash audio player in the HotPot module

by Josep M. Fontana -
THANKS very much Gordon!

Yes, you are right. I'm curious and I was going to ask you why the player had this mysterious behavior :-}

I should have known this was once again one of these relative vs. absolute path problems.

Again, big THANKS!

Josep M.
In reply to Gordon Bateson

Re: Problem with Flash audio player in the HotPot module

by Josep M. Fontana -
Woops. I added the lib.php file and it worked like a charm for the exercise called 'listening comprehension 1' but the exercise 'listening comprehension 2'  (which uses the same player in the same location (and calls the same audio file) continues to have the same problem. How strange.

Josep M.
In reply to Josep M. Fontana

Re: Problem with Flash audio player in the HotPot module

by Josep M. Fontana -
Hi Gordon. Some more bug reporting. I discovered what the difference is between exercises 'listening comprehension 1' and 'listening comprehension 2'. In the one where the Flash player works I used the HTML file, in the one that doesn't, I used the Hot Potatoe file. So, your fix seems to work properly for the HTML file (which before I added the lib.php file to the Hotpot directory didn't work either) but not if the exercise is created directly with the HP file.

Gotta run to go teaching.

Josep M.
In reply to Josep M. Fontana

Re: Problem with Flash audio player in the HotPot module

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Hi Josep,
yes, I can confirm the media player works when the quizzes are run from HTML files. I'll look into what happens when they are generated form the JQZ files and report back.

cheers
Gordon
In reply to Josep M. Fontana

Re: Problem with Flash audio player in the HotPot module

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Hello again Josep,

I think I have fixed the relative URLs in jqz files now. The problem was the ampersands are about triple encoded in the jqz file, so it is a little tricky to recognize them.

However, with a bit or trial and error, I got it working. The updated module will be available from CVS tomorrow, or you can use the zipped up "mod/hotpot/lib.php" attached to this message.

thanks as always for the detailed feedback!
Gordon