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

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.CustomInteraction
All Implemented Interfaces:
java.io.Serializable, Block, Flow, ObjectFlow, XmlNode, XmlObject, Validatable

public class CustomInteraction
extends Interaction
implements Block, Flow

CustomInteraction

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.content.basic.Block
DISPLAY_NAME
 
Fields inherited from interface org.qtitools.qti.node.content.basic.Flow
DISPLAY_NAME
 
Constructor Summary
CustomInteraction(XmlObject parent)
          Constructs object.
 
Method Summary
 void beforeProcessResponse()
          Perform any required processing for the interaction immediately before processResponse is called.
 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.
 ResponseDeclaration getResponseDeclaration()
          Gets the responseDeclaration for this interaction.
 java.lang.String getResponseIdentifier()
          Gets value of responseIdentifier attribute.
 java.util.List<java.lang.String> getShuffledOrder()
          If the interaction supports shuffling, then this method should return an ordered list of the shuffled elements' identifiers.
 void initialize()
          Initialize the interaction.
 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 processResponse(java.lang.String responseString)
          Given the user response to the interaction in the form of A string set the appropriate response variables.
 void setResponseIdentifier(java.lang.String responseIdentifier)
          Sets new value of responseIdentifier 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
processResponse
 
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

CustomInteraction

public CustomInteraction(XmlObject parent)
Constructs object.

Parameters:
parent - parent of constructed object
Method Detail

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

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

beforeProcessResponse

public void beforeProcessResponse()
Description copied from class: Interaction
Perform any required processing for the interaction immediately before processResponse is called. Most interactions wont need to do anything here - it is basically useful for interactions that need to set or reset A particular value (like EndAttemptInteraction).

Overrides:
beforeProcessResponse in class Interaction

getResponseDeclaration

public ResponseDeclaration getResponseDeclaration()
Description copied from class: Interaction
Gets the responseDeclaration for this interaction.

Overrides:
getResponseDeclaration in class Interaction
Returns:
the responseDeclaration for this interactions responseIdentifier

getResponseIdentifier

public java.lang.String getResponseIdentifier()
Description copied from class: Interaction
Gets value of responseIdentifier attribute.

Overrides:
getResponseIdentifier in class Interaction
Returns:
value of responseIdentifier attribute
See Also:
Interaction.setResponseIdentifier(java.lang.String)

getShuffledOrder

public java.util.List<java.lang.String> getShuffledOrder()
Description copied from class: Interaction
If the interaction supports shuffling, then this method should return an ordered list of the shuffled elements' identifiers.

Overrides:
getShuffledOrder in class Interaction
Returns:
Ordered list of identifiers, or null if the interaction doesn't support shuffling

initialize

public void initialize()
Description copied from class: Interaction
Initialize the interaction. Subclasses should override this method as required.

Overrides:
initialize in class Interaction

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>)

processResponse

public void processResponse(java.lang.String responseString)
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:
responseString - the string form of the response

setResponseIdentifier

public void setResponseIdentifier(java.lang.String responseIdentifier)
Description copied from class: Interaction
Sets new value of responseIdentifier attribute.

Overrides:
setResponseIdentifier in class Interaction
Parameters:
responseIdentifier - new value of responseIdentifier attribute
See Also:
Interaction.getResponseIdentifier()

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

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.