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

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

public class AssociateInteraction
extends BlockInteraction
implements SimpleAssociableChoiceContainer

An associate interaction is a blockInteraction that presents candidates with a number of choices and allows them to create associations between them. The associateInteraction must be bound to a response variable with base-type pair and either single or multiple cardinality. Attribute : shuffle [1]: boolean = false If the shuffle attribute is true then the delivery engine must randomize the order in which the choices are presented subject to the fixed attribute of the choice. Attribute : maxAssociations [1]: integer = 1 The maximum number of associations that the candidate is allowed to make. If maxAssociations is 0 then there is no restriction. If maxAssociations is greater than 1 (or 0) then the interaction must be bound to a response with multiple cardinality. Attribute : minAssociations [0..1]: integer = 0 The minimum number of associations that the candidate is required to make to form a valid response. If minAssociations is 0 then the candidate is not required to make any associations. minAssociations must be less than or equal to the limit imposed by maxAssociations. Contains : simpleAssociableChoice [1..*] An ordered set of choices.

Author:
Jonathon Hare
See Also:
Serialized Form

Field Summary
static int ATTR_MAX_ASSOCIATIONS_DEFAULT_VALUE
          Default value of maxAssociations attribute.
static java.lang.String ATTR_MAX_ASSOCIATIONS_NAME
          Name of maxAssociations attribute in xml schema.
static int ATTR_MIN_ASSOCIATIONS_DEFAULT_VALUE
          Default value of minAssociations attribute.
static java.lang.String ATTR_MIN_ASSOCIATIONS_NAME
          Name of minAssociations attribute in xml schema.
static boolean ATTR_SHUFFLE_DEFAULT_VALUE
          Default value of shuffle attribute.
static java.lang.String ATTR_SHUFFLE_NAME
          Name of shuffle 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.XmlNode
INDENT, NEW_LINE, SIMPLE_NAME_INNER_SEPARATOR, SIMPLE_NAMES_SEPARATOR
 
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
AssociateInteraction(XmlObject parent)
          Construct new interaction.
 
Method Summary
 java.util.List<? extends XmlNode> getChildren()
          Gets an unmodifiable list of the child elements.
 java.lang.String getClassTag()
          Gets QTI class name of this node.
 java.lang.Integer getMaxAssociations()
          Gets value of maxAssociations attribute.
 java.lang.Integer getMinAssociations()
          Gets value of minAssociations attribute.
 java.lang.Boolean getShuffle()
          Gets value of shuffle 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.
 SimpleAssociableChoice getSimpleAssociableChoice(java.lang.String identifier)
          Gets simpleAssociableChoice child with given identifier or null.
 java.util.List<SimpleAssociableChoice> getSimpleAssociableChoices()
          Gets simpleAssociableChoice children.
 void initialize()
          Initialize the interaction.
 void setMaxAssociations(java.lang.Integer maxAssociations)
          Sets new value of maxAssociations attribute.
 void setMinAssociations(java.lang.Integer minAssociations)
          Sets new value of minAssociations attribute.
 void setShuffle(java.lang.Boolean shuffle)
          Sets new value of shuffle attribute.
 ValidationResult validate()
          Validates this object.
 
Methods inherited from class org.qtitools.qti.node.item.interaction.BlockInteraction
getPrompt, setPrompt
 
Methods inherited from class org.qtitools.qti.node.item.interaction.Interaction
beforeProcessResponse, getResponseDeclaration, getResponseIdentifier, processResponse, processResponse, processResponse, setResponseIdentifier, validateResponse
 
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
 
Methods inherited from interface org.qtitools.qti.node.XmlNode
getAttributes, getFullName, getNodeGroups, getParent, getParentRoot, getSimpleName, getSourceFile, getSourceNode, getSourceString, getSourceUrl, hasChildNodes, load, load, load, load, setSourceFile, setSourceNode, setSourceString, setSourceUrl, toXmlString, toXmlString
 

Field Detail

CLASS_TAG

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


ATTR_SHUFFLE_NAME

public static java.lang.String ATTR_SHUFFLE_NAME
Name of shuffle attribute in xml schema.


ATTR_SHUFFLE_DEFAULT_VALUE

public static boolean ATTR_SHUFFLE_DEFAULT_VALUE
Default value of shuffle attribute.


ATTR_MAX_ASSOCIATIONS_NAME

public static java.lang.String ATTR_MAX_ASSOCIATIONS_NAME
Name of maxAssociations attribute in xml schema.


ATTR_MAX_ASSOCIATIONS_DEFAULT_VALUE

public static int ATTR_MAX_ASSOCIATIONS_DEFAULT_VALUE
Default value of maxAssociations attribute.


ATTR_MIN_ASSOCIATIONS_NAME

public static java.lang.String ATTR_MIN_ASSOCIATIONS_NAME
Name of minAssociations attribute in xml schema.


ATTR_MIN_ASSOCIATIONS_DEFAULT_VALUE

public static int ATTR_MIN_ASSOCIATIONS_DEFAULT_VALUE
Default value of minAssociations attribute.

Constructor Detail

AssociateInteraction

public AssociateInteraction(XmlObject parent)
Construct new interaction.

Parameters:
parent - Parent node
Method Detail

setShuffle

public void setShuffle(java.lang.Boolean shuffle)
Sets new value of shuffle attribute.

Parameters:
shuffle - new value of shuffle attribute
See Also:
getShuffle()

getShuffle

public java.lang.Boolean getShuffle()
Gets value of shuffle attribute.

Returns:
value of shuffle attribute
See Also:
setShuffle(java.lang.Boolean)

setMaxAssociations

public void setMaxAssociations(java.lang.Integer maxAssociations)
Sets new value of maxAssociations attribute.

Parameters:
maxAssociations - new value of maxAssociations attribute
See Also:
getMaxAssociations()

getMaxAssociations

public java.lang.Integer getMaxAssociations()
Gets value of maxAssociations attribute.

Returns:
value of maxAssociations attribute
See Also:
setMaxAssociations(java.lang.Integer)

setMinAssociations

public void setMinAssociations(java.lang.Integer minAssociations)
Sets new value of minAssociations attribute.

Parameters:
minAssociations - new value of minAssociations attribute
See Also:
getMinAssociations()

getMinAssociations

public java.lang.Integer getMinAssociations()
Gets value of minAssociations attribute.

Returns:
value of minAssociations attribute
See Also:
setMinAssociations(java.lang.Integer)

getSimpleAssociableChoices

public java.util.List<SimpleAssociableChoice> getSimpleAssociableChoices()
Gets simpleAssociableChoice children.

Returns:
simpleAssociableChoice children

getSimpleAssociableChoice

public SimpleAssociableChoice getSimpleAssociableChoice(java.lang.String identifier)
Gets simpleAssociableChoice child with given identifier or null.

Parameters:
identifier - given identifier
Returns:
simpleAssociableChoice with given identifier or null

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

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

initialize

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

Overrides:
initialize in class Interaction

getChildren

public java.util.List<? extends XmlNode> getChildren()
Gets an unmodifiable list of the child elements. Use the other methods on AssociateInteraction to add children to the correct group.

Overrides:
getChildren in class BlockInteraction
Returns:
List of child nodes

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


Copyright © 2009. All Rights Reserved.