org.qtitools.qti.node.item.interaction
Class ExtendedTextInteraction

java.lang.Object
  extended by org.qtitools.qti.node.AbstractNode
      extended by org.qtitools.qti.node.AbstractObject
          extended by org.qtitools.qti.node.content.BodyElement
              extended by org.qtitools.qti.node.item.interaction.Interaction
                  extended by org.qtitools.qti.node.item.interaction.BlockInteraction
                      extended by org.qtitools.qti.node.item.interaction.ExtendedTextInteraction
All Implemented Interfaces:
java.io.Serializable, Block, Flow, ObjectFlow, StringInteraction, XmlNode, XmlObject, Validatable

public class ExtendedTextInteraction
extends BlockInteraction
implements StringInteraction

An extended text interaction is a blockInteraction that allows the candidate to enter an extended amount of text. The extendedTextInteraction must be bound to a response variable with baseType of string, integer, or float. When bound to response variable with single cardinality a single string of text is required from the candidate. When bound to a response variable with multiple or ordered cardinality several separate text strings may be required, see maxStrings below. Attribute : maxStrings [0..1]: integer The maxStrings attribute is required when the interaction is bound to a response variable that is a container. A Delivery Engine must use the value of this attribute to control the maximum number of separate strings accepted from the candidate. When multiple strings are accepted, expectedLength applies to each string. Attribute : minStrings [0..1]: integer = 0 The minStrings attribute specifies the minimum number separate (non-empty) strings required from the candidate to form a valid response. If minStrings is 0 then the candidate is not required to enter any strings at all. minStrings must be less than or equal to the limit imposed by maxStrings. If the interaction is not bound to a container then there is a special case in which minStrings may be 1. In this case the candidate must enter a non-empty string to form a valid response. More complex constraints on the form of the string can be controlled with the patternMask attribute. Attribute : expectedLines [0..1]: integer The expectedLines attribute provides a hint to the candidate as to the expected number of lines of input required. A Delivery Engine should use the value of this attribute to set the size of the response box, where applicable. This is not a validity constraint. Attribute : format [0..1]: textFormat = plain Used to control the format of the text entered by the candidate. See textFormat below. This attribute affects the way the value of the associated response variable should be interpreted by response processing engines and also controls the way it should be captured in the delivery engine.

Author:
Jonathon Hare
See Also:
Serialized Form

Field Summary
static java.lang.String ATTR_EXPECTED_LINES_NAME
          Name of expectedLines attribute in xml schema.
static TextFormat ATTR_FORMAT_DEFAULT_VALUE
          Default value of format attribute.
static java.lang.String ATTR_FORMAT_NAME
          Name of format attribute in xml schema.
static java.lang.String ATTR_MAX_STRINGS_NAME
          Name of maxStrings attribute in xml schema.
static java.lang.Integer ATTR_MIN_STRINGS_DEFAULT_VALUE
          Name of minStrings attribute in xml schema.
static java.lang.String ATTR_MIN_STRINGS_NAME
          Name of minStrings attribute in xml schema.
static java.lang.String CLASS_TAG
          Name of this class in xml schema.
 
Fields inherited from class org.qtitools.qti.node.item.interaction.Interaction
ATTR_RESPONSE_IDENTIFIER_NAME, CLASS_TAG_SUFFIX, DISPLAY_NAME
 
Fields inherited from class org.qtitools.qti.node.content.BodyElement
ATTR_CLASS_NAME, ATTR_ID_NAME, ATTR_LABEL_NAME, ATTR_LANG_NAME
 
Fields inherited from interface org.qtitools.qti.node.item.interaction.StringInteraction
ATTR_BASE_DEFAULT_VALUE, ATTR_BASE_NAME, ATTR_EXPECTED_LENGTH_NAME, ATTR_PATTERN_MASK_NAME, ATTR_PLACEHOLDER_TEXT_NAME, ATTR_STRING_IDENTIFIER_NAME, KEY_EXPONENT_NAME, KEY_FLOAT_VALUE_NAME, KEY_INTEGER_VALUE_NAME, KEY_LEFT_DIGITS_NAME, KEY_NDP_NAME, KEY_NSF_NAME, KEY_RIGHT_DIGITS_NAME, KEY_STRING_VALUE_NAME
 
Fields inherited from interface org.qtitools.qti.node.content.basic.Block
DISPLAY_NAME
 
Fields inherited from interface org.qtitools.qti.node.content.basic.Flow
DISPLAY_NAME
 
Constructor Summary
ExtendedTextInteraction(XmlObject parent)
          Construct new interaction.
 
Method Summary
 java.lang.Integer getBase()
          Gets value of base attribute.
 java.lang.String getClassTag()
          Gets QTI class name of this node.
 java.lang.Integer getExpectedLength()
          Gets value of expectedLength attribute.
 java.lang.Integer getExpectedLines()
          Gets value of expectedLines attribute.
 TextFormat getFormat()
          Gets value of format attribute.
 java.lang.Integer getMaxStrings()
          Gets value of maxStrings attribute.
 java.lang.Integer getMinStrings()
          Gets value of minStrings attribute.
 java.lang.String getPatternMask()
          Gets value of patternMask attribute.
 java.lang.String getPlaceholderText()
          Gets value of placeholderText attribute.
 java.lang.String getStringIdentifier()
          Gets value of stringIdentifier attribute.
 ResponseDeclaration getStringIdentifierResponseDeclaration()
          Gets ResponseDeclaration corresponding to the stringIdentifier attribute
 void processResponse(java.util.List<java.lang.String> responseList)
          Given the user response to the interaction in the form of A string set the appropriate response variables.
 void setBase(java.lang.Integer base)
          Sets new value of base attribute.
 void setExpectedLength(java.lang.Integer expectedLength)
          Sets new value of expectedLength attribute.
 void setExpectedLines(java.lang.Integer expectedLines)
          Sets new value of expectedLines attribute.
 void setFormat(TextFormat format)
          Sets new value of format attribute.
 void setMaxStrings(java.lang.Integer maxStrings)
          Sets new value of maxStrings attribute.
 void setMinStrings(java.lang.Integer minStrings)
          Sets new value of minStrings attribute.
 void setPatternMask(java.lang.String patternMask)
          Sets new value of patternMask attribute.
 void setPlaceholderText(java.lang.String placeholderText)
          Sets new value of placeholderText attribute.
 void setStringIdentifier(java.lang.String stringIdentifier)
          Sets new value of stringIdentifier attribute.
 ValidationResult validate()
          Validates this object.
 boolean validateResponse()
          Validate the response associated with this interaction Subclasses should override this method as required.
 
Methods inherited from class org.qtitools.qti.node.item.interaction.BlockInteraction
getChildren, getPrompt, setPrompt
 
Methods inherited from class org.qtitools.qti.node.item.interaction.Interaction
beforeProcessResponse, getResponseDeclaration, getResponseIdentifier, getShuffledOrder, initialize, processResponse, processResponse, setResponseIdentifier
 
Methods inherited from class org.qtitools.qti.node.content.BodyElement
appendChild, evaluate, getClassAttr, getFirstChild, getId, getLabel, getLang, getLastChild, insertBefore, removeChild, replaceChild, search, search, search, setId, setLabel, setLang
 
Methods inherited from class org.qtitools.qti.node.AbstractObject
getParent, getParentItem, getParentResult, getParentTest, setParent
 
Methods inherited from class org.qtitools.qti.node.AbstractNode
attrToXmlString, bodyToXmlString, getAttributes, getFullName, getIndent, getNode, getNode, getNode, getNodeGroups, getParentRoot, getSimpleName, getSourceFile, getSourceNode, getSourceString, getSourceUrl, hasChildNodes, load, load, load, load, loadAttributes, readChild, readChildren, setParent, setSourceFile, setSourceNode, setSourceString, setSourceUrl, toXmlString, toXmlString, validateAttributes, validateChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_TAG

public static java.lang.String CLASS_TAG
Name of this class in xml schema.


ATTR_MAX_STRINGS_NAME

public static java.lang.String ATTR_MAX_STRINGS_NAME
Name of maxStrings attribute in xml schema.


ATTR_MIN_STRINGS_NAME

public static java.lang.String ATTR_MIN_STRINGS_NAME
Name of minStrings attribute in xml schema.


ATTR_MIN_STRINGS_DEFAULT_VALUE

public static java.lang.Integer ATTR_MIN_STRINGS_DEFAULT_VALUE
Name of minStrings attribute in xml schema.


ATTR_EXPECTED_LINES_NAME

public static java.lang.String ATTR_EXPECTED_LINES_NAME
Name of expectedLines attribute in xml schema.


ATTR_FORMAT_NAME

public static java.lang.String ATTR_FORMAT_NAME
Name of format attribute in xml schema.


ATTR_FORMAT_DEFAULT_VALUE

public static TextFormat ATTR_FORMAT_DEFAULT_VALUE
Default value of format attribute.

Constructor Detail

ExtendedTextInteraction

public ExtendedTextInteraction(XmlObject parent)
Construct new interaction.

Parameters:
parent - Parent node
Method Detail

getClassTag

public java.lang.String getClassTag()
Description copied from interface: XmlNode
Gets QTI class name of this node.

QTI class name has very important role during loading/saving nodes.

For example: Java class name is AssessmentTest; QTI class name is assessmentTest.

Specified by:
getClassTag in interface XmlNode
Specified by:
getClassTag in class AbstractNode
Returns:
QTI class name of this node

setMaxStrings

public void setMaxStrings(java.lang.Integer maxStrings)
Sets new value of maxStrings attribute.

Parameters:
maxStrings - new value of maxStrings attribute
See Also:
getMaxStrings()

getMaxStrings

public java.lang.Integer getMaxStrings()
Gets value of maxStrings attribute.

Returns:
value of maxStrings attribute
See Also:
setMaxStrings(java.lang.Integer)

setMinStrings

public void setMinStrings(java.lang.Integer minStrings)
Sets new value of minStrings attribute.

Parameters:
minStrings - new value of minStrings attribute
See Also:
getMinStrings()

getMinStrings

public java.lang.Integer getMinStrings()
Gets value of minStrings attribute.

Returns:
value of minStrings attribute
See Also:
setMinStrings(java.lang.Integer)

setExpectedLines

public void setExpectedLines(java.lang.Integer expectedLines)
Sets new value of expectedLines attribute.

Parameters:
expectedLines - new value of expectedLines attribute
See Also:
getExpectedLines()

getExpectedLines

public java.lang.Integer getExpectedLines()
Gets value of expectedLines attribute.

Returns:
value of expectedLines attribute
See Also:
setExpectedLines(java.lang.Integer)

setFormat

public void setFormat(TextFormat format)
Sets new value of format attribute.

Parameters:
format - new value of format attribute
See Also:
getFormat()

getFormat

public TextFormat getFormat()
Gets value of format attribute.

Returns:
value of format attribute
See Also:
setFormat(org.qtitools.qti.value.TextFormat)

getBase

public java.lang.Integer getBase()
Description copied from interface: StringInteraction
Gets value of base attribute.

Specified by:
getBase in interface StringInteraction
Returns:
value of base attribute
See Also:
StringInteraction.setBase(java.lang.Integer)

getExpectedLength

public java.lang.Integer getExpectedLength()
Description copied from interface: StringInteraction
Gets value of expectedLength attribute.

Specified by:
getExpectedLength in interface StringInteraction
Returns:
value of expectedLength attribute
See Also:
StringInteraction.setExpectedLength(java.lang.Integer)

getPatternMask

public java.lang.String getPatternMask()
Description copied from interface: StringInteraction
Gets value of patternMask attribute.

Specified by:
getPatternMask in interface StringInteraction
Returns:
value of patternMask attribute
See Also:
StringInteraction.setPatternMask(java.lang.String)

getPlaceholderText

public java.lang.String getPlaceholderText()
Description copied from interface: StringInteraction
Gets value of placeholderText attribute.

Specified by:
getPlaceholderText in interface StringInteraction
Returns:
value of placeholderText attribute
See Also:
StringInteraction.setPlaceholderText(java.lang.String)

getStringIdentifier

public java.lang.String getStringIdentifier()
Description copied from interface: StringInteraction
Gets value of stringIdentifier attribute.

Specified by:
getStringIdentifier in interface StringInteraction
Returns:
value of stringIdentifier attribute
See Also:
StringInteraction.setStringIdentifier(java.lang.String)

setBase

public void setBase(java.lang.Integer base)
Description copied from interface: StringInteraction
Sets new value of base attribute.

Specified by:
setBase in interface StringInteraction
Parameters:
base - new value of base attribute
See Also:
StringInteraction.getBase()

setExpectedLength

public void setExpectedLength(java.lang.Integer expectedLength)
Description copied from interface: StringInteraction
Sets new value of expectedLength attribute.

Specified by:
setExpectedLength in interface StringInteraction
Parameters:
expectedLength - new value of expectedLength attribute
See Also:
StringInteraction.getExpectedLength()

setPatternMask

public void setPatternMask(java.lang.String patternMask)
Description copied from interface: StringInteraction
Sets new value of patternMask attribute.

Specified by:
setPatternMask in interface StringInteraction
Parameters:
patternMask - new value of patternMask attribute
See Also:
StringInteraction.getPatternMask()

setPlaceholderText

public void setPlaceholderText(java.lang.String placeholderText)
Description copied from interface: StringInteraction
Sets new value of placeholderText attribute.

Specified by:
setPlaceholderText in interface StringInteraction
Parameters:
placeholderText - new value of placeholderText attribute
See Also:
StringInteraction.getPlaceholderText()

setStringIdentifier

public void setStringIdentifier(java.lang.String stringIdentifier)
Description copied from interface: StringInteraction
Sets new value of stringIdentifier attribute.

Specified by:
setStringIdentifier in interface StringInteraction
Parameters:
stringIdentifier - new value of stringIdentifier attribute
See Also:
StringInteraction.getStringIdentifier()

getStringIdentifierResponseDeclaration

public ResponseDeclaration getStringIdentifierResponseDeclaration()
Description copied from interface: StringInteraction
Gets ResponseDeclaration corresponding to the stringIdentifier attribute

Specified by:
getStringIdentifierResponseDeclaration in interface StringInteraction
Returns:
ResponseDeclaration identified by interactions stringIdentifier

validate

public ValidationResult validate()
Description copied from interface: Validatable
Validates this object.

Specified by:
validate in interface Validatable
Overrides:
validate in class Interaction
Returns:
validation result

processResponse

public void processResponse(java.util.List<java.lang.String> responseList)
Description copied from class: Interaction
Given the user response to the interaction in the form of A string set the appropriate response variables.

Overrides:
processResponse in class Interaction
Parameters:
responseList - Response to process
See Also:
AssessmentItem.setResponses(java.util.Map>)

validateResponse

public boolean validateResponse()
Description copied from class: Interaction
Validate the response associated with this interaction Subclasses should override this method as required.

Overrides:
validateResponse in class Interaction
Returns:
true if the response is valid, false otherwise


Copyright © 2009. All Rights Reserved.