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

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.InlineInteraction
                      extended by org.qtitools.qti.node.item.interaction.TextEntryInteraction
All Implemented Interfaces:
java.io.Serializable, Flow, Inline, ObjectFlow, StringInteraction, XmlNode, XmlObject, Validatable

public class TextEntryInteraction
extends InlineInteraction
implements StringInteraction

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 single cardinality only. The baseType must be one of string, integer, or float. Note: Spec is slightly wrong: record response is also allowed from inherited StringInteraction

Author:
Jonathon Hare
See Also:
Serialized Form

Field Summary
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.Inline
DISPLAY_NAME
 
Fields inherited from interface org.qtitools.qti.node.content.basic.Flow
DISPLAY_NAME
 
Constructor Summary
TextEntryInteraction(XmlObject parent)
          Construct new interaction.
 
Method Summary
 java.lang.Integer getBase()
          Gets value of base attribute.
 java.util.List<? extends XmlNode> getChildren()
          Get A list of the content child nodes of this element
 java.lang.String getClassTag()
          Gets QTI class name of this node.
 java.lang.Integer getExpectedLength()
          Gets value of expectedLength 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 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.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.

Constructor Detail

TextEntryInteraction

public TextEntryInteraction(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

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

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

getChildren

public java.util.List<? extends XmlNode> getChildren()
Description copied from class: BodyElement
Get A list of the content child nodes of this element

Specified by:
getChildren in class BodyElement
Returns:
List of child nodes


Copyright © 2009. All Rights Reserved.