org.qtitools.qti.node.test
Class SectionPart

java.lang.Object
  extended by org.qtitools.qti.node.AbstractNode
      extended by org.qtitools.qti.node.AbstractObject
          extended by org.qtitools.qti.node.UniqueObject
              extended by org.qtitools.qti.node.test.ControlObject
                  extended by org.qtitools.qti.node.test.AbstractPart
                      extended by org.qtitools.qti.node.test.SectionPart
All Implemented Interfaces:
java.io.Serializable, XmlNode, XmlObject, Validatable
Direct Known Subclasses:
AssessmentItemRef, AssessmentSection

public abstract class SectionPart
extends AbstractPart

Abstract super class for assessmentSection and assessmentItemRef.

Author:
Jiri Kajaba
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 boolean ATTR_REQUIRED_DEFAULT_VALUE
          Default value of required attribute.
static java.lang.String ATTR_REQUIRED_NAME
          Name of required attribute in xml schema.
static java.lang.String DISPLAY_NAME
          Display name of this part.
 
Fields inherited from class org.qtitools.qti.node.test.ControlObject
finished, VARIABLE_DURATION_NAME
 
Fields inherited from class org.qtitools.qti.node.UniqueObject
ATTR_IDENTIFIER_NAME
 
Fields inherited from interface org.qtitools.qti.node.XmlNode
INDENT, NEW_LINE, SIMPLE_NAME_INNER_SEPARATOR, SIMPLE_NAMES_SEPARATOR
 
Constructor Summary
SectionPart(AbstractPart parent)
          Constructs part.
 
Method Summary
 java.lang.Boolean getFixed()
          Gets value of fixed attribute.
 ItemSessionControl getItemSessionControl()
          Gets itemSessionControl object for this part.
 AbstractPart getParent()
          Gets parent of this node or null (if node is root; for example AssessmentTest).
 AssessmentSection getParentSection()
          Gets parent assessment section of this part or null if parent is test part.
 java.lang.Boolean getRequired()
          Gets value of required attribute.
 boolean isJumpSafeSource()
          Returns true if it is safe to jump from this object; false otherwise.
 boolean isJumpSafeTarget()
          Returns true if this object is safe target of jump; false otherwise.
 void setFixed(java.lang.Boolean fixed)
          Sets new value of fixed attribute.
 void setParent(AbstractPart parent)
          Sets new parent of this part.
 void setRequired(java.lang.Boolean required)
          Sets new value of required attribute.
 
Methods inherited from class org.qtitools.qti.node.test.AbstractPart
getBranchRules, getItemSessionControlNode, getParentTestPart, getPreConditions, setItemSessionControlNode
 
Methods inherited from class org.qtitools.qti.node.test.ControlObject
getChildren, getDuration, getFinishedCount, getGlobalIndex, getPresentedCount, getResponseTime, getTimeLimit, getTotalCount, getTotalTime, initialize, isBuiltInVariable, isChildOf, isFinished, isPresented, lookup, lookupItemRef, lookupItemRefs, lookupItemRefs, lookupValue, passMaximumTimeLimit, passMinimumTimeLimit, setFinished, setTimeLimit
 
Methods inherited from class org.qtitools.qti.node.UniqueObject
getIdentifier, getSimpleName, setIdentifier, validateAttributes
 
Methods inherited from class org.qtitools.qti.node.AbstractObject
getParentItem, getParentResult, getParentTest, setParent
 
Methods inherited from class org.qtitools.qti.node.AbstractNode
attrToXmlString, bodyToXmlString, getAttributes, getClassTag, getFullName, getIndent, getNode, getNode, getNode, getNodeGroups, getParentRoot, getSourceFile, getSourceNode, getSourceString, getSourceUrl, hasChildNodes, load, load, load, load, loadAttributes, readChild, readChildren, setParent, setSourceFile, setSourceNode, setSourceString, setSourceUrl, toXmlString, toXmlString, validate, 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, 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

DISPLAY_NAME

public static final java.lang.String DISPLAY_NAME
Display name of this part.

See Also:
Constant Field Values

ATTR_REQUIRED_NAME

public static final java.lang.String ATTR_REQUIRED_NAME
Name of required attribute in xml schema.

See Also:
Constant Field Values

ATTR_REQUIRED_DEFAULT_VALUE

public static final boolean ATTR_REQUIRED_DEFAULT_VALUE
Default value of required attribute.

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
Constructor Detail

SectionPart

public SectionPart(AbstractPart parent)
Constructs part.

Parameters:
parent - parent of constructed part.
Method Detail

getParent

public AbstractPart getParent()
Description copied from interface: XmlNode
Gets parent of this node or null (if node is root; for example AssessmentTest).

While testing some nodes (for example expressions) don't have properly set parent, but it is usable only for testing. (Some nodes cannot exists without parent even for testing).

Specified by:
getParent in interface XmlNode
Specified by:
getParent in interface XmlObject
Overrides:
getParent in class ControlObject
Returns:
parent of this node or null (if node is root; for example AssessmentTest)

setParent

public void setParent(AbstractPart parent)
Sets new parent of this part.

Parameters:
parent - new parent of this part
See Also:
getParent()

getParentSection

public AssessmentSection getParentSection()
Gets parent assessment section of this part or null if parent is test part.

Returns:
parent assessment section of this part or null if parent is test part

getRequired

public java.lang.Boolean getRequired()
Gets value of required attribute.

Returns:
value of required attribute
See Also:
setRequired(java.lang.Boolean)

setRequired

public void setRequired(java.lang.Boolean required)
Sets new value of required attribute.

Parameters:
required - new value of required attribute
See Also:
getRequired()

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

getItemSessionControl

public ItemSessionControl getItemSessionControl()
Description copied from class: AbstractPart
Gets itemSessionControl object for this part.

Use this method instead of getItemSessionControlNode, because returned object of this method contains all fields (they are inherited from parent if they are not defined in this part).

Specified by:
getItemSessionControl in class AbstractPart
Returns:
itemSessionControl object for this part

isJumpSafeSource

public boolean isJumpSafeSource()
Description copied from class: AbstractPart
Returns true if it is safe to jump from this object; false otherwise.

It is not safe to jump from shuffled not fixed object (or if any parent is shuffled and not fixed), because object could be moved after jump target (it is not allowed).

Overrides:
isJumpSafeSource in class AbstractPart
Returns:
true if it is safe to jump from this object; false otherwise

isJumpSafeTarget

public boolean isJumpSafeTarget()
Description copied from class: AbstractPart
Returns true if this object is safe target of jump; false otherwise.

It is not save to jump on not required object in selection group (same for all its parents), because object could disappear (not be selected) and jump target is no longer valid.

It is not safe to jump on shuffled not fixed object (or if any parent is shuffled and not fixed), because object could be moved before jump source (it is not allowed).

Overrides:
isJumpSafeTarget in class AbstractPart
Returns:
true if this object is safe target of jump; false otherwise


Copyright © 2009. All Rights Reserved.