TQS Home
Trivia Quiz Shell Version 2.8 Now Available!Bot Productions Home
TQS 2.0

Back to Reference

INCORRECT Element

Specifies text to be displayed when a question is answered incorrectly (QUESTIONS location type only). Specifies a sound to be associated with an incorrect answer (all location types).

Syntax
<INCORRECT
  INSERT="insert"
  SOUND="sound">incorrect</INCORRECT>
Attributes
INSERT
A sequence of characters that exists within the main incorrect string that will be replaced with the correct answer.
SOUND
TQS 2.5 The file name of a sound to be played when the answer or word is guessed incorrectly.
Placement

TQS 2.0, 2.1 The INCORRECT element must be a child of the QUESTIONS element, either inside of an individual location element or within global settings.

TQS 2.5 The INCORRECT element can be a direct child of the GLOBAL element, or can be used within these elements within a location or global settings: QUESTIONS and HANGMAN; or within these elements within global settings only: HTML and CUSTOM_*.

Children

No children are supported within the INCORRECT element.

Remarks

By default, the string "Incorrect!" is displayed, without any correct answer. For multiple-choice questions, the correct answer will be the letter, not the answer string. There is no default sound.

When used as a direct child of the GLOBAL element, the INCORRECT element is only used to retrieve the SOUND attribute. The QUESTIONS location retrieves the display text only when the INCORRECT element is located within a QUESTIONS element, either within a location or global settings.

The HANGMAN location type will play sounds as specified by the SOUND attribute, but will not display any text.

With the HTML and CUSTOM_* location types, the sounds will not be used; you may invoke them by calling the playSound function.

In order for any sounds to be played, the TQS element's USESSOUNDS element must be set to "1".

TQS 2.5 The sound file must reside in the data root folder. This is, by default, the folder containing the .TQS file.

  • The data root folder can be set with the TQS element's DATAROOT attribute. To specify an absolute path, such as an Internet address, precede the path with NOROOT?.
  • TQS 2.6 To specify an embedded file, precede the path with EMBED?.
Examples

In the following example, if the correct answer is A and the user selects B, TQS will display the following:
Wrong! The correct answer is A.

<INCORRECT
  INSERT="%s">Wrong! The correct answer is %s.</INCORRECT>
<GLOBAL>
  <CORRECT SOUND="defcorrect.wav"/>
  <INCORRECT SOUND="defincorrect.wav"/>
  <QUESTIONS ...>
    <CORRECT>Right answer!</CORRECT>
    <INCORRECT>Wrong answer!</CORRECT>
  </QUESTIONS>
  <HANGMAN ...>
    <CORRECT SOUND="hangcorrect.wav"/>
    <INCORRECT SOUND="hangdead.wav"/>
  </HANGMAN>
</GLOBAL>

Use the playSound function within your SCRIPT code to invoke your custom correct and incorrect sounds.

<GLOBAL>
  ...
  <CUSTOM_FOO ...>
    <CORRECT SOUND="foocorrect.wav"/>
    <INCORRECT SOUND="fooincorrect.wav"/>
    ...
  </CUSTOM_FOO>
</GLOBAL>

©2020 Bot Productions. All rights reserved.Last Updated: January 5, 2006