playSoundFile FunctionPlays the specified sound file. SyntaxplaySoundFile(fileName); Parameters
ReturnsThere is no return value. RemarksIn order for any sounds to be played, the TQS element's USESSOUNDS element must be set to "1". The sound file must reside in the data root folder. This is, by default, the folder containing the .TQS file.
Use the playSound function to play the sound associated with a correct or an incorrect answer. Examples<DIVCODE XMLCOMPLIANT="1"> ... <BUTTON onclick="onBtnClick(0)">Cow</BUTTON> <BUTTON onclick="onBtnClick(1)">Horse</BUTTON> <BUTTON onclick="onBtnClick(2)">Pig</BUTTON> ... </DIVCODE> function onBtnClick(btnID) { playSoundFile("animal"+btnID+".wav"); } function onBtnClick(btnID) { playSoundFile("EMBED?animal"+btnID+".wav"); } |