Text Entry Interaction (QTI)
A textEntry interaction is an inlineInteraction that obtains a simple piece of text from the candidate. Like inlineChoiceInteraction, the delivery engine must allow the candidate to review their choice within the context of the surrounding text. The textEntryInteraction must be bound to a response variable with either single or record cardinality only. For single cardinality the baseType must be one of string, integer or float. For record cardinality the fields are ‘stringValue’, ‘floatValue’, etc. The relevant class is:
TextEntryInteraction is a String interaction and can be bound to numeric response variables, instead of strings, if desired. If detailed information about a numeric response is required then the string interaction can be bound to a response variable with record cardinality. The resulting value contains the following fields:
stringValue - the string, as typed by the candidate;
floatValue - the numeric value of the string typed by the candidate, as a float;
integerValue - the numeric value of the string typed by the candidate if no fractional digits or exponent were specified, otherwise NULL. An integer;
leftDigits - the number of digits to the left of the point. An integer;
rightDigits - rightDigits: the number of digits to the right of the point. An integer;
ndp- the number of fractional digits specified by the candidate. If no exponent was given this is the same as rightDigits. An integer;
nsf - the number of significant digits specified by the candidate. An integer;
exponent - the integer exponent given by the candidate or NULL if none was specified.
Data Model

Example

The third, and final method of filling gaps is to use an textEntryInteraction which requires the candidate to construct their own response, typically by typing it in. Notice that a guide to the amount of text to be entered is given in the expectedLength attribute - though candidates should be allowed to enter more if desired.
The scoring for this item could have just matched the correct response but actually uses a mapping to enable partial credit for york (spelled without a capital letter). When mapping strings the mapping always takes place case sensitively. This example also illustrates the use of the mapping when the response only has single cardinality.
<assessmentItem xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_v2p2 http://www.imsglobal.org/xsd/qti/qtiv2p2/imsqti_v2p2p2.xsd" identifier="textEntry" title="Richard III (Take 3)" adaptive="false" timeDependent="false">
<responseDeclaration identifier="RESPONSE" cardinality="single" baseType="string">
<correctResponse>
<value>York</value>
</correctResponse>
<mapping defaultValue="0">
<mapEntry mapKey="York" mappedValue="1"/>
<mapEntry mapKey="york" mappedValue="0.5"/>
</mapping>
</responseDeclaration>
<outcomeDeclaration identifier="SCORE" cardinality="single" baseType="float"/>
<itemBody>
<p>
Identify the missing word in this famous quote from Shakespeare's Richard III.
</p>
<blockquote>
<p>
Now is the winter of our discontent
<br/>
Made glorious summer by this sun of
<textEntryInteraction responseIdentifier="RESPONSE" expectedLength="15"/>
;
<br/>
And all the clouds that lour'd upon our house
<br/>
In the deep bosom of the ocean buried.
</p>
</blockquote>
</itemBody>
<responseProcessing template="http://www.imsglobal.org/question/qti_v2p2/rptemplates/map_response"/>
</assessmentItem>