Most question types use answer matching sections in the XML to define which feedback to give on an answer. An example of a matching section is:

<mapping correct="1" stop="0">
  <match inlineChoice="A" inlineOption="2" />
  <match inlineChoice="B" inlineOption="4" />
  <and>
    <match inlineChoice="C" inlineOption="1" />
    <match inlineChoice="D" inlineOption="3" />
  </and>
  <not>
    <match inlineChoice="E" pattern="/^inhibitor$/i" />
  </not>
  <range inlineChoice="speed" minval="119.999" maxval="120.001" />
  <feedback>Very good.</feedback>
</mapping>

A answer mating section always starts with a <mapping> tag. The correct="1" indicates whether the answer is correct or not if this mapping matches the current answer. The (optional) stop="0" means that if this mapping matches, further matches should still be checked. stop="1" means that matching should stop if this mapping matches.

Inside the <mapping> tag there are two types of tags allowed, tags that do answer-matching, and <feedback> tags. If all tags that do answer-matching return a positive result, the <feedback> tags are shown to the user. The different answer-matching tags are: match, range, and, or, not.

Tag: <match />

Match tags are used to match answers that contain text. This includes Select & Order and Multiple Answer questions, as the "answer" to those questions is a (text) list of the selected options. The <match> tag takes several attributes:

Examples:

<match pattern="A" />

Used in Select&Order and Multiple answer questions. Match true if the answer matches the pattern.

<match inlineChoice="A" inlineOption="B" />

Used in FillBlanks questions. Match true if dropdown-style inlineChoice with id A contains the option with id B.

<match inlineChoice="A" pattern="B" />

Used in FillBlanks questions. Selects all (freeform-style) inlineChoice with an id that matches pattern A. If the value of any of these inlineChoices matches pattern B the match is successfull.

<match inlineChoice="A" pattern="B" matchAll="1" />

Used in FillBlanks questions. Selects all (freeform-style) inlineChoice with an id that matches pattern A. If the value of all of these inlineChoices matches pattern B the match is successfull. If any choice does not match the match fails.

<match hotspot="A" />

Used in Hotspot questions. Selects all hotspots with an id that matches pattern A. If any of these hotspots has a draggable, the match is successfull.

<match hotspot="A" matchAll="h" />

Used in Hotspot questions. Selects all hotspots with an id that matches pattern A. If all of these hotspots have a draggable, the match is successful.

<match hotspot="A" draggable="B" />

Used in Drag&Drop questions. Selects all hotspots with an id that matches pattern A. Selects all draggables with an id that matches pattern B. If any of the selected hotspots contains any of the selected draggables the match is successful.

<match hotspot="A" draggable="B" matchAll="d" />

Used in Drag&Drop questions. Selects all hotspots with an id that matches pattern A. Selects all draggables with an id that matches pattern B. If all of the selected draggables are on a selected hotspot the match is successful.

<match hotspot="A" draggable="B" matchAll="h" />

Used in Drag&Drop questions. Selects all hotspots with an id that matches pattern A. Selects all draggables with an id that matches pattern B. If all of the selected hotspots contain at least one of the selected draggable the match is successfull. If any hotspot does not contain one of the selected draggables, the match fails. This is thus only possble if there are at least as many selected draggables as there are selected hotspots.

<match hotspot="A" draggable="B" matchAll="b" />

Used in Drag&Drop questions. Selects all hotspots with an id that matches pattern A. Selects all draggables with an id that matches pattern B. If all of the selected draggables are on a selected hotspot AND all selected hotspots contain at least one of the selected draggables then the match is successfull.

Tag: <range />

Range checks numeric values against a range. Numeric values come from Value questions, from Fillblanks questions with freeform inlineChoices, or from mathematical expressions. Allowed attributes in range tags are:

Tag: <and>...</and>

And can contain multiple other answer-matching tags. The result of and is true only if all of the contained answer-matching tags are true.

Tag: <or>...</or>

Or can contain multiple other answer-matching tags. The result of and is true if any of the contained answer-matching tags are true.

Tag: <not>...</not>

Not can contain one other answer-matching tags. Not returns true if the containing matching tag returns false.