A Teachpoint exercise is described by an exercise document. The exercise document is used to produce both
The exercise document is usually not written directly.
Instead, it is produced by processing an exercise core document
(which describes the questions and answers)
using an exercise stylesheet
(which describes the page layout,
navigation links, and miscellaneous text
of the exercise and answer pages).
An exercise core document describes a list of questions. Here's an example:
<?xml version="1.0" encoding="UTF-8"?> <tp:exercise xmlns:tp="http://teachpoint.com"> <tp:questions> <tp:question type="exclusive_choice"> "Conifers" are so named because <tp:item>they are cone-shaped</tp:item> <tp:item>they originated during the Coniceous era</tp:item> <tp:item correct="yes">they carry their seeds in cones</tp:item> . </tp:question> </tp:questions> </tp:exercise>
If this exercise is processed with the default exercise stylesheet, the resulting exercise page looks like this.
The answer page looks like this if the question is answered correctly, otherwise like this.
The available tags are as follows:
<tp:exercise> <tp:questions> ... </tp:questions> </tp:exercise>These tags enclose the list of questions.
<tp:question type="X" [weight="Y"] [format="Z"] [ordered="W"]> ... [ <tp:explanation> ... </tp:explanation> ] </tp:question>Specifies a question of type X:
<tp:item [correct="yes"] [size="X"] [exact="Y"]> ... [ <tp:explanation> ... </tp:explanation> ] </tp:item>Specifies an answer choices or components. For type file-in-the-blank this represents a text field to be filled in by the student, and the enclosed text is the correct answer. For the other types this represents an alternative answer, and the enclosed content is that answer (text, images, or a combination).
Each student completion of an exercise produces a grade between 0 and 1. Each question can be assigned a weight in the computation of this grade, using the weight attribute of <tp:question> tag. By default each question has weight 1, so the exercise grade is the average of the question grades.
Each <tp:item> element represents an alternative answer. The correct="yes" attribute specifies the right answer.
The body of teach <tp:item> element is arbitrary XHTML. It may contains text, images, etc. If a <tp:explanation> tag is present, its content is displayed in the answer page if this item is selected by the student.
The optional format attribute of <tp:question> specifies the layout to be used for the question.
Each <tp:item> element represents an alternative answer. The correct="yes" attribute specifies a right answer; multiple answers may have this attribute. If a <tp:explanation> tag is present, its content is displayed in the answer page if the item is answered incorrectly.
The alternative answers are presented in a list with a checkbox next to each item.
Each <tp:item> element represents one "answer field". The body of the element is the correct answer (case is ignored when evaluating responses). If a <tp:explanation> tag is present, its content is displayed in the answer page if the item is answered incorrectly.
The optional size attribute gives the width of the input field in characters. If the exact="no" attribute is given, a student response will be counted as correct if it contains the correct answer as a substring.
If the ordered="no" attribute is present, then the order of responses doesn't matter.
Exercise documents can contain the following tags, which are normally added to exercise core documents by the exercise stylesheet.
<tp:anchor action="X"> ... </tp:anchor>This generates a navigation hyperlink. X is one of:
<tp:if page="X"> ... </tp:if>This outputs the enclosed content if the document is being to generate a:
<tp:if questionid="X" response="Y"> ... </tp:if>This outputs the enclosed content according to the student response to question X, where Y is one of
<tp:if itemid="X" response="Y"> ... <tp:/if>This output the enclosed content according to the student response to item X, where Y is one of
<tp:show what="X"/>Show text according to X:
<tp:show questionid="X" what="Y"/>Show text for question X:
<tp:show itemid="x" what="input"/>Show text for item X: