org.qtitools.qti.node.content
Class ItemBody

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.content.ItemBody
All Implemented Interfaces:
java.io.Serializable, XmlNode, XmlObject, Validatable

public class ItemBody
extends BodyElement

The item body contains the text, graphics, media objects, and interactions that describe the item's content and information about how it is structured. The body is presented by combining it with stylesheet information, either explicitly or implicitly using the default style rules of the delivery or authoring system. The body must be presented to the candidate when the associated item session is in the interacting state. In this state, the candidate must be able to interact with each of the visible interactions and therefore set or update the values of the associated response variables. The body may be presented to the candidate when the item session is in the closed or review state. In these states, although the candidate's responses should be visible, the interactions must be disabled so as to prevent the candidate from setting or updating the values of the associated response variables. Finally, the body may be presented to the candidate in the solution state, in which case the correct values of the response variables must be visible and the associated interactions disabled. The content model employed by this specification uses many concepts taken directly from [XHTML]. In effect, this part of the specification defines A profile of XHTML. Only some of the elements defined in XHTML are allowable in an assessmentItem and of those that are, some have additional constraints placed on their attributes. Only those elements from XHTML that are explicitly defined within this specification can be used. See XHTML Elements for details. Finally, this specification defines some new elements which are used to represent the interactions and to control the display of Integrated Feedback and content restricted to one or more of the defined content views.

Author:
Jonathon Hare, Jiri Kajaba
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.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
ItemBody(XmlObject parent)
          Constructs assessmentItem.
 
Method Summary
 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.
 Interaction getInteraction(java.lang.String responseIdentifier)
          Get the interaction for a given responseIdentifier.
 java.util.List<Interaction> getInteractions()
          Get a snapshot of all the interactions within this itemBody.
 java.util.List<TemplateElement> getTemplates()
          Get a snapshot of all the templates within this itemBody.
 java.util.List<TemplateElement> getTemplates(java.lang.String templateIdentifier)
          Get the templates for a given templateIdentifier.
 boolean hasFeedback()
          Determine if this item has any inline or block feedback.
 void initialize()
          Initialize the itemBody by initializing all the child interactions.
 boolean willShowFeedback()
          Determine whether any feedback should be shown.
 
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, 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, 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

CLASS_TAG

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

See Also:
Constant Field Values
Constructor Detail

ItemBody

public ItemBody(XmlObject parent)
Constructs assessmentItem.

Parameters:
parent - The parent assessmentItem of this itemBody.
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

willShowFeedback

public boolean willShowFeedback()
Determine whether any feedback should be shown.

Returns:
true if any feedback should be shown; false otherwise;

hasFeedback

public boolean hasFeedback()
Determine if this item has any inline or block feedback.

Returns:
true if the item has inline or block feedback; false otherwise;

getInteractions

public java.util.List<Interaction> getInteractions()
Get a snapshot of all the interactions within this itemBody. The returned list is unmodifiable and cannot be used for adding new interactions to the itemBody.

Returns:
unmodifiable list of interactions in the itemBody.

getInteraction

public Interaction getInteraction(java.lang.String responseIdentifier)
Get the interaction for a given responseIdentifier.

Parameters:
responseIdentifier - responseIdentifier to search with.
Returns:
interaction with matching responseIdentifier, or null if not found.

getTemplates

public java.util.List<TemplateElement> getTemplates()
Get a snapshot of all the templates within this itemBody. The returned list is unmodifiable and cannot be used for adding new templates to the itemBody.

Returns:
unmodifiable list of interactions in the itemBody.

getTemplates

public java.util.List<TemplateElement> getTemplates(java.lang.String templateIdentifier)
Get the templates for a given templateIdentifier.

Parameters:
templateIdentifier - templateIdentifier to search with.
Returns:
unmodifiable list of templates with matching templateIdentifier, or null if not found.

initialize

public void initialize()
Initialize the itemBody by initializing all the child interactions.


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.