The three sections of a single numeric question are shown here:
<ANSWER ... > <RESPONSES> ... </RESPONSES> <HINTS> ... </HINTS>
The structure of each of these sections is shown below.
<ANSWER ANS=l TOL=t EPS=e HELP=url>
The <ANSWER...> element automatically generates the proper HTML for the form used by the reader to supply her answer.
The ANS=l attribute specifies that l is the correct answer for the question.
The tolerance, t, is the relative amount that the supplied answer can be different from the correct one and still be judged correct. In other words, a supplied answer, ans, is judged to be correct iff ABS(ans-l) <= ABS(t*l).
The difference, e, if greater than or equal to 0, is the absolute difference allowed between the supplied answer, ans, and the correct answer, l. By default, EPS=-1 and is ignored. If EPS is specified as greater than or equal to 0, it over-rides TOL.
The HELP="url" attribute is optional. If given, it specifies the URL of a help document, and a link to that is automatically included after the answer form..
<RESPONSES> <WHEN ANS=x> . . . . . . <WHEN EXPR=e> . . . . . . <WHEN CORRECT> . . . . . . <WHEN INCORRECT> . . . . . . </RESPONSES>The <WHEN...> elements specify the conditions under which the following text is to be displayed as a response to a supplied answer.
<WHEN ANS=x> specifies that the following text is to be displayed whenever the reader supplies value x as an answer.
<WHEN EXPR=e> specifies that the following text is to be displayed as a response whenver the expression, e, evaluates to true. Expression e can contain ans as a variable; ans will be the numeric answer supplied by the reader. For example:
<WHEN EXPR="ans<2.7">means that the following text will be displayed as a response if the reader supplies an answer of less than 2.7.
<WHEN CORRECT> specifies that the following text is to be displayed whenever the user selects the correct answer, and no other WHEN clause has been printed.
<WHEN INCORRECT> specifies that the following text is to be displayed whenever the user selects an incorrect answer, and no other WHEN clause has been printed.
All WHEN elements are optional; if none are given then the RESPONSES section need not be given either. In either case, a suitable default response is provided, giving feedback as to whether the selected answer was correct or not.