org.qtitools.qti.node.item.interaction.choice
Class Choice

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.choice.Choice
All Implemented Interfaces:
java.io.Serializable, XmlNode, XmlObject, Validatable
Direct Known Subclasses:
AssociableChoice, HotspotChoice, Hottext, InlineChoice, SimpleChoice

public abstract class Choice
extends BodyElement

Many of the interactions involve choosing one or more predefined choices. These choices all have the following attributes in common: Attribute : identifier [1]: identifier The identifier of the choice. This identifier must not be used by any other choice or item variable. Attribute : fixed [0..1]: boolean = false If fixed is true for A choice then the position of this choice within the interaction must not be changed by the delivery engine even if the immediately enclosing interaction supports the shuffling of choices. If no value is specified then the choice is free to be shuffled. In Item Templates, the visibility of choices can be controlled by setting the value(s) of an associated template variable during template processing. For information about item templates see Item Templates. Attribute : templateIdentifier [0..1]: identifier The identifier of A template variable that must have A base-type of identifier and be either single of multiple cardinality. When the associated interaction is part of an Item Template the value of the identified template variable is used to control the visibility of the choice. When A choice is hidden it is not selectable and its content is not visible to the candidate unless otherwise stated. Attribute : showHide [0..1]: showHide = show The showHide attribute determines how the visibility of the choice is controlled. If set to show then the choice is hidden by default and shown only if the associated template variable matches, or contains, the identifier of the choice. If set to hide then the choice is shown by default and hidden if the associated template variable matches, or contains, the choice's identifier.

Author:
Jonathon Hare
See Also:
Serialized Form

Field Summary
static boolean ATTR_FIXED_DEFAULT_VALUE
          Default value of fixed attribute.
static java.lang.String ATTR_FIXED_NAME
          Name of fixed attribute in xml schema.
static java.lang.String ATTR_IDENTIFIER_NAME
          Name of identifier attribute in xml schema.
static java.lang.String ATTR_TEMPLATE_IDENTIFIER_NAME
          Name of templateIdentifier attribute in xml schema.
static java.lang.String ATTR_VISIBILITY_MODE_NAME
          Name of showHide attribute in xml schema.
 
Fields inherited from class org.qtitools.qti.node.content.BodyElement
ATTR_CLASS_NAME, ATTR_ID_NAME, ATTR_LABEL_NAME, ATTR_LANG_NAME, DISPLAY_NAME
 
Fields inherited from interface org.qtitools.qti.node.XmlNode
INDENT, NEW_LINE, SIMPLE_NAME_INNER_SEPARATOR, SIMPLE_NAMES_SEPARATOR
 
Constructor Summary
Choice(XmlObject parent)
          Construct new choice.
 
Method Summary
 java.lang.Boolean getFixed()
          Gets value of fixed attribute.
 java.lang.String getIdentifier()
          Gets value of identifier attribute.
 java.lang.String getTemplateIdentifier()
          Gets value of templateIdentifier attribute.
 VisibilityMode getVisibilityMode()
          Gets value of showHide attribute.
 void setFixed(java.lang.Boolean fixed)
          Sets new value of fixed attribute.
 void setIdentifier(java.lang.String identifier)
          Sets new value of identifier attribute.
 void setTemplateIdentifier(java.lang.String templateIdentifier)
          Sets new value of templateIdentifier attribute.
 void setVisibilityMode(VisibilityMode visibilityMode)
          Sets new value of showHide attribute.
 
Methods inherited from class org.qtitools.qti.node.content.BodyElement
appendChild, evaluate, getChildren, 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, getClassTag, 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, validate, 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, getClassTag, getFullName, getNodeGroups, getParentRoot, getSimpleName, getSourceFile, getSourceNode, getSourceString, getSourceUrl, hasChildNodes, load, load, load, load, setSourceFile, setSourceNode, setSourceString, setSourceUrl, toXmlString, toXmlString
 
Methods inherited from interface org.qtitools.qti.validation.Validatable
validate
 

Field Detail

ATTR_IDENTIFIER_NAME

public static final java.lang.String ATTR_IDENTIFIER_NAME
Name of identifier attribute in xml schema.

See Also:
Constant Field Values

ATTR_FIXED_NAME

public static final java.lang.String ATTR_FIXED_NAME
Name of fixed attribute in xml schema.

See Also:
Constant Field Values

ATTR_FIXED_DEFAULT_VALUE

public static final boolean ATTR_FIXED_DEFAULT_VALUE
Default value of fixed attribute.

See Also:
Constant Field Values

ATTR_TEMPLATE_IDENTIFIER_NAME

public static final java.lang.String ATTR_TEMPLATE_IDENTIFIER_NAME
Name of templateIdentifier attribute in xml schema.

See Also:
Constant Field Values

ATTR_VISIBILITY_MODE_NAME

public static final java.lang.String ATTR_VISIBILITY_MODE_NAME
Name of showHide attribute in xml schema.

See Also:
Constant Field Values
Constructor Detail

Choice

public Choice(XmlObject parent)
Construct new choice.

Parameters:
parent - Parent node
Method Detail

getIdentifier

public java.lang.String getIdentifier()
Gets value of identifier attribute.

Returns:
value of identifier attribute
See Also:
setIdentifier(java.lang.String)

setIdentifier

public void setIdentifier(java.lang.String identifier)
Sets new value of identifier attribute.

Parameters:
identifier - new value of identifier attribute
See Also:
getIdentifier()

getFixed

public java.lang.Boolean getFixed()
Gets value of fixed attribute.

Returns:
value of fixed attribute
See Also:
setFixed(java.lang.Boolean)

setFixed

public void setFixed(java.lang.Boolean fixed)
Sets new value of fixed attribute.

Parameters:
fixed - new value of fixed attribute
See Also:
getFixed()

getVisibilityMode

public VisibilityMode getVisibilityMode()
Gets value of showHide attribute.

Returns:
value of showHide attribute
See Also:
setVisibilityMode(org.qtitools.qti.node.test.VisibilityMode)

setVisibilityMode

public void setVisibilityMode(VisibilityMode visibilityMode)
Sets new value of showHide attribute.

Parameters:
visibilityMode - new value of showHide attribute
See Also:
getVisibilityMode()

getTemplateIdentifier

public java.lang.String getTemplateIdentifier()
Gets value of templateIdentifier attribute.

Returns:
value of templateIdentifier attribute
See Also:
setTemplateIdentifier(java.lang.String)

setTemplateIdentifier

public void setTemplateIdentifier(java.lang.String templateIdentifier)
Sets new value of templateIdentifier attribute.

Parameters:
templateIdentifier - new value of templateIdentifier attribute
See Also:
getTemplateIdentifier()


Copyright © 2009. All Rights Reserved.