Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using audio for feedback in quizzes

Status
Not open for further replies.

djs45uk

Technical User
Nov 7, 2004
103
GB
Hi all

I am using the quiz templates to create a set of simple drag and drop quizzes for use by disabled adults at the College where I work. They are unable to read so audio is essential to their independent learning.

I've added audio to the questions but I need also to add audio to the feedback part (e.g. which says 'Well done!' or 'Incorrect' when the user clicks Check Answer).

Can anyone tell me how I can do this?

If you think it is not possible, can anyone suggest how I could change the feedback so that it displays a big green tick or big red cross when the user clicks 'Check Answer'.

Any help is greatly appreciated!

Daniel
 
There are many ways, but the easiest is to attach a sound to the button itself. In the button editing timeline, select the "Down" frame. There's "Sound" dropdown menu in the Properties panel, which lets you choose a sound when the button is interacted.

Kenneth Kawamoto
 
Thank you! That sounds great. There's a 'but' coming though.

It seems I can't enter the button's timeline.

When I double-click on the button nothing happens.

Is that because Macromedia have locked this down on their templates? Or is it because I'm being an idiot and doing something wrong?
 
I should also add that I've checked the layer is unlocked and I've tried double-clicking on the button in the library too to no avail.
 
Perhaps you're using a button component. You cannot edit the timeline of components by just double clicking them.

Then what you need is to write a script instead.

1. Import a sound file, for example "welldone.mp3".
2. Give it an Identifier name, for example "soundWelldone".
3. Place a button component on the main timeline and give a name, for example "buttonWelldone".
4. Write this script on the main timeline:
[tt]//
var soundObjectWelldone:Sound = new Sound();
soundObjectWelldone.attachSound("soundWelldone");
//
buttonWelldone.onPress = function():Void {
soundObjectWelldone.start();
};
//[/tt]

Every time you press the button "buttonWelldone", the sound "soundWelldone" will be played.

Kenneth Kawamoto
 
Brilliant thank you!

Do you know whether I can get the quiz component to interact with the script (it's the drag and drop component that I'm using).

I only want it to say 'well done' if they get all the answers right. I'd like it to say 'incorrect' if they get one or more wrong.

I really appreciate your time!

Daniel
 
I don't know your "drag and drop component", but sure, you can incorporate the script above to your quiz.

When the item is dropped I suppose you are checking if it is the right answer. Just add the script to it.

Something like:

[tt]//
if(Right answer){
soundObjectWelldone.start();
// do other things
} else {
soundObjectIncorrect.start();
// do other things
}
//[/tt]

Kenneth Kawamoto
 
No I don't know it either -- I'm just using the Quiz template that comes with Macromedia. They call it the 'Quiz Component' which you just drag onto the timeline and it seems to do all the hard stuff behind the scenes.

I've have a play around with what you've given me and see if I can't get it working.

Many thanks

Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top