Skip to content

Strings

String input fields can be created using the string input type in the input element.

Example

<p>
    Question: Which city is the capital of Germany?
</p>
<p>
    Answer: <input><string>Berlin</string></input>
</p>

Attributes

The string element supports the following attributes:

Attribute Type Default Description
casesensitive xs:boolean - Whether or not the solution should be checked in a case sensitive way or not.
characters xs:string - When set, limits the characters that the user may use to the characters occuring in the given string.
charactershints xs:boolean - Whether or not to give live hints about the allowed characters when the user has not yet submitted the input value.
cloze xs:boolean - Controls whether or not the string field should be displayed like an item of a cloze test.
credits xs:nonNegativeInteger 1 Number of credit points the user gets awarded for this input value.
maxlength xs:positiveInteger | Unbounded - Maximum length of the string that the user may enter.
maxlengthhints xs:boolean - Whether or not to give live hints about the allowed maximal length when the user has not yet submitted the input value.
minlength xs:nonNegativeInteger - Minimum length of the string that the user may enter.
minlengthhints xs:boolean - Whether or not to give live hints about the allowed minimal length when the user has not yet submitted the input value.
model xs:Name - Name of the model to use for this input value. If this attribute is not set, the input model associated to the input field containing this input value is used.
trim xs:boolean - Whether or not whitespace at the beginning and end of the string (both the user input and the solution string) should be ignored.