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

Back to Reference

HTML Element

Contains the HTML code for a location of type "HTML", in which you present data to the user with HTML.

Syntax
<HTML
  SUBST="subst"
  STATEONLOAD="stateonload"
  SHOWSCORE="showscore"
  ONLOAD="onload">
  ...
</HTML>
Attributes
SUBST
TQS 2.1 Allows you to substitute the dynamic value DATAROOT in the HTML code. The contents of the attribute must be in the form of "string,DATAROOT".

TQS 2.5 All TQS dynamic values are supported. The attribute must be in the form of "string,dynval"; multiple substitutions can be specified by joining them with a semicolon (;).

STATEONLOAD
TQS 2.5 Specifies the state that the location should be set to when it is invoked. The default is to set the state to "PARTIAL"; other values include "EMPTY", "DONE", and "DONE100".
SHOWSCORE
TQS 2.5 If set to "1", TQS will display score statistics for the current location, such as number tried, correct, wrong, and percent correct. You must use the scoring functions to manipulate the scores. Defaults to being hidden.
ONLOAD
TQS 2.7 Specifies JavaScript to be executed when TQS switches to the location. Can be set both within global settings and within individual location's HTML elements. If the location's ONLOAD attribute is present, its code will be executed instead of the code within global settings (that is, they are not both executed).

This attribute is analagous to the ONLOAD element used by custom location types.

Placement

The HTML element must be a child of a LOC element whose TYPE attribute is set to "HTML", or of the GLOBAL element when specifying settings for all HTML locations.

Children

The following child elements are supported:

When inside a LOC element, no child elements will be interpreted by TQS.

Remarks

TQS 2.7 and earlier All id names, as well as any custom JavaScript variables or functions specified in event handlers, must begin with "S_". This is not required as of TQS 2.8.

The entire contents, between <HTML> and </HTML>, will be inserted as HTML into the TQS window. This code must be XML compliant, meaning that:

  • Every tag has a closing tag, whether or not it is required by HTML. For example, <BR> in HTML must be entered as <BR/>.
  • All attributes must be in quotes.

For more information on TQS's state tracking and scoring capabilities, read the TQS Tutorial, Part XIII.

Examples

<HTML SUBST="%data%,DATAROOT">
  <div align="center">
  This is a HTML location.<br/>
  <img src="%data%myimage.jpg" width="40"
    height="30"/>
  </div>
</HTML>
<HTML
  STATEONLOAD="DONE"
  SUBST="%data%,DATAROOT;%name%,USERNAME">
  ...
</HTML>
<HTML SUBST="%embed%,EMBEDROOT">
  <div align="center">
  Below is an embedded image.<br/>
  <img src="%embed%myimage.jpg" width="40"
    height="30"/>
  </div>
</HTML>


©2016 Bot Productions. All rights reserved.Last Updated: September 9, 2007