org.qtitools.qti.node.test
Class ItemSessionControl

java.lang.Object
  extended by org.qtitools.qti.node.AbstractNode
      extended by org.qtitools.qti.node.AbstractObject
          extended by org.qtitools.qti.node.test.ItemSessionControl
All Implemented Interfaces:
java.io.Serializable, XmlNode, XmlObject, Validatable

public class ItemSessionControl
extends AbstractObject

When items are referenced as part of A test, the test may impose constraints on how many attempts and which states are allowed. These constraints can be specified for individual items, for whole sections, or for an entire testPart. By default, A setting at testPart level affects all items in that part unless the setting is overridden at the assessmentSection level or ultimately at the individual assessmentItemRef. The defaults given below are used only in the absence of any applicable constraint.

Author:
Jiri Kajaba
See Also:
Serialized Form

Field Summary
static boolean ALLOW_COMMENT_DEFAULT_VALUE
          Default value of getAllowComment method.
static boolean ALLOW_REVIEW_DEFAULT_VALUE
          Default value of getAllowReview method.
static boolean ALLOW_SKIPPING_DEFAULT_VALUE
          Default value of getAllowSkipping method.
static java.lang.Boolean ATTR_ALLOW_COMMENT_DEFAULT_VALUE
          Default value of allowComment attribute.
static java.lang.String ATTR_ALLOW_COMMENT_NAME
          Name of allowComment attribute in xml schema.
static java.lang.Boolean ATTR_ALLOW_REVIEW_DEFAULT_VALUE
          Default value of allowReview attribute.
static java.lang.String ATTR_ALLOW_REVIEW_NAME
          Name of allowReview attribute in xml schema.
static java.lang.Boolean ATTR_ALLOW_SKIPPING_DEFAULT_VALUE
          Default value of allowSkipping attribute.
static java.lang.String ATTR_ALLOW_SKIPPING_NAME
          Name of allowSkipping attribute in xml schema.
static java.lang.Integer ATTR_MAX_ATTEMPTS_DEFAULT_VALUE
          Default value of maxAttempts attribute.
static java.lang.String ATTR_MAX_ATTEMPTS_NAME
          Name of maxAttempts attribute in xml schema.
static java.lang.Boolean ATTR_SHOW_FEEDBACK_DEFAULT_VALUE
          Default value of showFeedback attribute.
static java.lang.String ATTR_SHOW_FEEDBACK_NAME
          Name of showFeedback attribute in xml schema.
static java.lang.Boolean ATTR_SHOW_SOLUTION_DEFAULT_VALUE
          Default value of showSolution attribute.
static java.lang.String ATTR_SHOW_SOLUTION_NAME
          Name of showSolution attribute in xml schema.
static java.lang.Boolean ATTR_VALIDATE_RESPONSES_DEFAULT_VALUE
          Default value of validateResponses attribute.
static java.lang.String ATTR_VALIDATE_RESPONSES_NAME
          Name of validateResponses attribute in xml schema.
static java.lang.String CLASS_TAG
          Name of this class in xml schema.
static int MAX_ATTEMPTS_DEFAULT_VALUE
          Default value of getMaxAttempts method.
static boolean SHOW_FEEDBACK_DEFAULT_VALUE
          Default value of getShowFeedback method.
static boolean SHOW_SOLUTION_DEFAULT_VALUE
          Default value of getShowSolution method.
static boolean VALIDATE_RESPONSES_DEFAULT_VALUE
          Default value of getValidateResponses method.
 
Fields inherited from interface org.qtitools.qti.node.XmlNode
INDENT, NEW_LINE, SIMPLE_NAME_INNER_SEPARATOR, SIMPLE_NAMES_SEPARATOR
 
Constructor Summary
ItemSessionControl(AbstractPart parent)
          Constructs object.
 
Method Summary
protected  java.lang.String attrToXmlString(int depth, boolean printDefaultAttributes)
          Prints attributes of this node into xml string.
 boolean getAllowComment()
          Gets final allowComment value.
 java.lang.Boolean getAllowCommentAttrValue()
          Gets value of allowComment attribute.
 boolean getAllowReview()
          Gets final allowReview value.
 java.lang.Boolean getAllowReviewAttrValue()
          Gets value of allowReview attribute.
 boolean getAllowSkipping()
          Gets final allowSkipping value.
 java.lang.Boolean getAllowSkippingAttrValue()
          Gets value of allowSkipping attribute.
 java.lang.String getClassTag()
          Gets QTI class name of this node.
 int getMaxAttempts()
          Gets final maxAttempts value.
 java.lang.Integer getMaxAttemptsAttrValue()
          Gets value of maxAttempts attribute.
 AbstractPart getParent()
          Gets parent of this node or null (if node is root; for example AssessmentTest).
protected  boolean getParentsAllowComment()
          Gets parent's (parent of parent of this itemSessionControl) final allowComment value or default value if parent of this itemSessionControl is TestPart.
protected  boolean getParentsAllowReview()
          Gets parent's (parent of parent of this itemSessionControl) final allowReview value or default value if parent of this itemSessionControl is TestPart.
protected  boolean getParentsAllowSkipping()
          Gets parent's (parent of parent of this itemSessionControl) final allowSkipping value or default value if parent of this itemSessionControl is TestPart.
protected  java.lang.Integer getParentsMaxAttempts()
          Gets parent's (parent of parent of this itemSessionControl) final maxAttempts value or default value if parent of this itemSessionControl is TestPart.
protected  boolean getParentsShowFeedback()
          Gets parent's (parent of parent of this itemSessionControl) final showFeedback value or default value if parent of this itemSessionControl is TestPart.
protected  boolean getParentsShowSolution()
          Gets parent's (parent of parent of this itemSessionControl) final showSolution value or default value if parent of this itemSessionControl is TestPart.
protected  boolean getParentsValidateResponses()
          Gets parent's (parent of parent of this itemSessionControl) final validateResponses value or default value if parent of this itemSessionControl is TestPart.
 boolean getShowFeedback()
          Gets final showFeedback value.
 java.lang.Boolean getShowFeedbackAttrValue()
          Gets value of showFeedback attribute.
 boolean getShowSolution()
          Gets final showSolution value.
 java.lang.Boolean getShowSolutionAttrValue()
          Gets value of showSolution attribute.
 boolean getValidateResponses()
          Gets final validateResponses value.
 java.lang.Boolean getValidateResponsesAttrValue()
          Gets value of validateResponses attribute.
 void setAllowCommentAttrValue(java.lang.Boolean allowComment)
          Sets new value of allowComment attribute.
 void setAllowReviewAttrValue(java.lang.Boolean allowReview)
          Sets new value of allowReview attribute.
 void setAllowSkippingAttrValue(java.lang.Boolean allowSkipping)
          Sets new value of allowSkipping attribute.
 void setMaxAttemptsAttrValue(java.lang.Integer maxAttempts)
          Sets new value of maxAttempts attribute.
 void setShowFeedbackAttrValue(java.lang.Boolean showFeedback)
          Sets new value of showFeedback attribute.
 void setShowSolutionAttrValue(java.lang.Boolean showSolution)
          Sets new value of showSolution attribute.
 void setValidateResponsesAttrValue(java.lang.Boolean validateResponses)
          Sets new value of validateResponses attribute.
 java.lang.String toXmlString(int depth, boolean printDefaultAttributes)
          Prints this node and all its children into string.
 
Methods inherited from class org.qtitools.qti.node.AbstractObject
getParentItem, getParentResult, getParentTest, setParent
 
Methods inherited from class org.qtitools.qti.node.AbstractNode
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, 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
 
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

ATTR_MAX_ATTEMPTS_NAME

public static final java.lang.String ATTR_MAX_ATTEMPTS_NAME
Name of maxAttempts attribute in xml schema.

See Also:
Constant Field Values

ATTR_MAX_ATTEMPTS_DEFAULT_VALUE

public static final java.lang.Integer ATTR_MAX_ATTEMPTS_DEFAULT_VALUE
Default value of maxAttempts attribute.


MAX_ATTEMPTS_DEFAULT_VALUE

public static final int MAX_ATTEMPTS_DEFAULT_VALUE
Default value of getMaxAttempts method.

See Also:
Constant Field Values

ATTR_SHOW_FEEDBACK_NAME

public static final java.lang.String ATTR_SHOW_FEEDBACK_NAME
Name of showFeedback attribute in xml schema.

See Also:
Constant Field Values

ATTR_SHOW_FEEDBACK_DEFAULT_VALUE

public static final java.lang.Boolean ATTR_SHOW_FEEDBACK_DEFAULT_VALUE
Default value of showFeedback attribute.


SHOW_FEEDBACK_DEFAULT_VALUE

public static final boolean SHOW_FEEDBACK_DEFAULT_VALUE
Default value of getShowFeedback method.

See Also:
Constant Field Values

ATTR_ALLOW_REVIEW_NAME

public static final java.lang.String ATTR_ALLOW_REVIEW_NAME
Name of allowReview attribute in xml schema.

See Also:
Constant Field Values

ATTR_ALLOW_REVIEW_DEFAULT_VALUE

public static final java.lang.Boolean ATTR_ALLOW_REVIEW_DEFAULT_VALUE
Default value of allowReview attribute.


ALLOW_REVIEW_DEFAULT_VALUE

public static final boolean ALLOW_REVIEW_DEFAULT_VALUE
Default value of getAllowReview method.

See Also:
Constant Field Values

ATTR_SHOW_SOLUTION_NAME

public static final java.lang.String ATTR_SHOW_SOLUTION_NAME
Name of showSolution attribute in xml schema.

See Also:
Constant Field Values

ATTR_SHOW_SOLUTION_DEFAULT_VALUE

public static final java.lang.Boolean ATTR_SHOW_SOLUTION_DEFAULT_VALUE
Default value of showSolution attribute.


SHOW_SOLUTION_DEFAULT_VALUE

public static final boolean SHOW_SOLUTION_DEFAULT_VALUE
Default value of getShowSolution method.

See Also:
Constant Field Values

ATTR_ALLOW_COMMENT_NAME

public static final java.lang.String ATTR_ALLOW_COMMENT_NAME
Name of allowComment attribute in xml schema.

See Also:
Constant Field Values

ATTR_ALLOW_COMMENT_DEFAULT_VALUE

public static final java.lang.Boolean ATTR_ALLOW_COMMENT_DEFAULT_VALUE
Default value of allowComment attribute.


ALLOW_COMMENT_DEFAULT_VALUE

public static final boolean ALLOW_COMMENT_DEFAULT_VALUE
Default value of getAllowComment method.

See Also:
Constant Field Values

ATTR_ALLOW_SKIPPING_NAME

public static final java.lang.String ATTR_ALLOW_SKIPPING_NAME
Name of allowSkipping attribute in xml schema.

See Also:
Constant Field Values

ATTR_ALLOW_SKIPPING_DEFAULT_VALUE

public static final java.lang.Boolean ATTR_ALLOW_SKIPPING_DEFAULT_VALUE
Default value of allowSkipping attribute.


ALLOW_SKIPPING_DEFAULT_VALUE

public static final boolean ALLOW_SKIPPING_DEFAULT_VALUE
Default value of getAllowSkipping method.

See Also:
Constant Field Values

ATTR_VALIDATE_RESPONSES_NAME

public static final java.lang.String ATTR_VALIDATE_RESPONSES_NAME
Name of validateResponses attribute in xml schema.

See Also:
Constant Field Values

ATTR_VALIDATE_RESPONSES_DEFAULT_VALUE

public static final java.lang.Boolean ATTR_VALIDATE_RESPONSES_DEFAULT_VALUE
Default value of validateResponses attribute.


VALIDATE_RESPONSES_DEFAULT_VALUE

public static final boolean VALIDATE_RESPONSES_DEFAULT_VALUE
Default value of getValidateResponses method.

See Also:
Constant Field Values
Constructor Detail

ItemSessionControl

public ItemSessionControl(AbstractPart parent)
Constructs object.

Parameters:
parent - parent of created object
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 AbstractObject
Returns:
parent of this node or null (if node is root; for example AssessmentTest)

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

getMaxAttemptsAttrValue

public java.lang.Integer getMaxAttemptsAttrValue()
Gets value of maxAttempts attribute.

Returns:
value of maxAttempts attribute
See Also:
setMaxAttemptsAttrValue(java.lang.Integer)

setMaxAttemptsAttrValue

public void setMaxAttemptsAttrValue(java.lang.Integer maxAttempts)
Sets new value of maxAttempts attribute.

Parameters:
maxAttempts - new value of maxAttempts attribute
See Also:
getMaxAttemptsAttrValue()

getShowFeedbackAttrValue

public java.lang.Boolean getShowFeedbackAttrValue()
Gets value of showFeedback attribute.

Returns:
value of showFeedback attribute
See Also:
setShowFeedbackAttrValue(java.lang.Boolean)

setShowFeedbackAttrValue

public void setShowFeedbackAttrValue(java.lang.Boolean showFeedback)
Sets new value of showFeedback attribute.

Parameters:
showFeedback - new value of showFeedback attribute
See Also:
getShowFeedbackAttrValue()

getAllowReviewAttrValue

public java.lang.Boolean getAllowReviewAttrValue()
Gets value of allowReview attribute.

Returns:
value of allowReview attribute
See Also:
setAllowReviewAttrValue(java.lang.Boolean)

setAllowReviewAttrValue

public void setAllowReviewAttrValue(java.lang.Boolean allowReview)
Sets new value of allowReview attribute.

Parameters:
allowReview - new value of allowReview attribute
See Also:
getAllowReviewAttrValue()

getShowSolutionAttrValue

public java.lang.Boolean getShowSolutionAttrValue()
Gets value of showSolution attribute.

Returns:
value of showSolution attribute
See Also:
setShowSolutionAttrValue(java.lang.Boolean)

setShowSolutionAttrValue

public void setShowSolutionAttrValue(java.lang.Boolean showSolution)
Sets new value of showSolution attribute.

Parameters:
showSolution - new value of showSolution attribute
See Also:
getShowSolutionAttrValue()

getAllowCommentAttrValue

public java.lang.Boolean getAllowCommentAttrValue()
Gets value of allowComment attribute.

Returns:
value of allowComment attribute
See Also:
setAllowCommentAttrValue(java.lang.Boolean)

setAllowCommentAttrValue

public void setAllowCommentAttrValue(java.lang.Boolean allowComment)
Sets new value of allowComment attribute.

Parameters:
allowComment - new value of allowComment attribute
See Also:
getAllowCommentAttrValue()

getAllowSkippingAttrValue

public java.lang.Boolean getAllowSkippingAttrValue()
Gets value of allowSkipping attribute.

Returns:
value of allowSkipping attribute
See Also:
setAllowSkippingAttrValue(java.lang.Boolean)

setAllowSkippingAttrValue

public void setAllowSkippingAttrValue(java.lang.Boolean allowSkipping)
Sets new value of allowSkipping attribute.

Parameters:
allowSkipping - new value of allowSkipping attribute
See Also:
getAllowSkippingAttrValue()

getValidateResponsesAttrValue

public java.lang.Boolean getValidateResponsesAttrValue()
Gets value of validateResponses attribute.

Returns:
value of validateResponses attribute
See Also:
setValidateResponsesAttrValue(java.lang.Boolean)

setValidateResponsesAttrValue

public void setValidateResponsesAttrValue(java.lang.Boolean validateResponses)
Sets new value of validateResponses attribute.

Parameters:
validateResponses - new value of validateResponses attribute
See Also:
getValidateResponsesAttrValue()

toXmlString

public java.lang.String toXmlString(int depth,
                                    boolean printDefaultAttributes)
Description copied from interface: XmlNode
Prints this node and all its children into string.

Specified by:
toXmlString in interface XmlNode
Overrides:
toXmlString in class AbstractNode
Parameters:
depth - indent (0 = no indent)
printDefaultAttributes - whether print attribute's default values
Returns:
xml string of this node and all its children
See Also:
XmlNode.toXmlString()

attrToXmlString

protected java.lang.String attrToXmlString(int depth,
                                           boolean printDefaultAttributes)
Description copied from class: AbstractNode
Prints attributes of this node into xml string.

Overrides:
attrToXmlString in class AbstractNode
Parameters:
depth - depth in xml tree (root = 0)
printDefaultAttributes - whether print attributes with default values
Returns:
xml string with printed attributes of this node

getMaxAttempts

public int getMaxAttempts()
Gets final maxAttempts value.
  1. returns value of corresponding attribute if it is not null
  2. returns default value if parent of this itemSessionControl is TestPart
  3. returns parent's final maxAttempts value (parent must be SectionPart)

Returns:
final maxAttempts value

getParentsMaxAttempts

protected java.lang.Integer getParentsMaxAttempts()
Gets parent's (parent of parent of this itemSessionControl) final maxAttempts value or default value if parent of this itemSessionControl is TestPart.

Returns:
parent's final maxAttempts value or default value

getShowFeedback

public boolean getShowFeedback()
Gets final showFeedback value.
  1. returns value of corresponding attribute if it is not null
  2. returns default value if parent of this itemSessionControl is TestPart
  3. returns parent's final showFeedback value (parent must be SectionPart)

Returns:
final showFeedback value

getParentsShowFeedback

protected boolean getParentsShowFeedback()
Gets parent's (parent of parent of this itemSessionControl) final showFeedback value or default value if parent of this itemSessionControl is TestPart.

Returns:
parent's final showFeedback value or default value

getAllowReview

public boolean getAllowReview()
Gets final allowReview value.
  1. returns value of corresponding attribute if it is not null
  2. returns default value if parent of this itemSessionControl is TestPart
  3. returns parent's final allowReview value (parent must be SectionPart)

Returns:
final allowReview value

getParentsAllowReview

protected boolean getParentsAllowReview()
Gets parent's (parent of parent of this itemSessionControl) final allowReview value or default value if parent of this itemSessionControl is TestPart.

Returns:
parent's final allowReview value or default value

getShowSolution

public boolean getShowSolution()
Gets final showSolution value.
  1. returns value of corresponding attribute if it is not null
  2. returns default value if parent of this itemSessionControl is TestPart
  3. returns parent's final showSolution value (parent must be SectionPart)

Returns:
final showSolution value

getParentsShowSolution

protected boolean getParentsShowSolution()
Gets parent's (parent of parent of this itemSessionControl) final showSolution value or default value if parent of this itemSessionControl is TestPart.

Returns:
parent's final showSolution value or default value

getAllowComment

public boolean getAllowComment()
Gets final allowComment value.
  1. returns value of corresponding attribute if it is not null
  2. returns default value if parent of this itemSessionControl is TestPart
  3. returns parent's final allowComment value (parent must be SectionPart)

Returns:
final allowComment value

getParentsAllowComment

protected boolean getParentsAllowComment()
Gets parent's (parent of parent of this itemSessionControl) final allowComment value or default value if parent of this itemSessionControl is TestPart.

Returns:
parent's final allowComment value or default value

getAllowSkipping

public boolean getAllowSkipping()
Gets final allowSkipping value.
  1. returns value of corresponding attribute if it is not null
  2. returns default value if parent of this itemSessionControl is TestPart
  3. returns parent's final allowSkipping value (parent must be SectionPart)

Returns:
final allowSkipping value

getParentsAllowSkipping

protected boolean getParentsAllowSkipping()
Gets parent's (parent of parent of this itemSessionControl) final allowSkipping value or default value if parent of this itemSessionControl is TestPart.

Returns:
parent's final allowSkipping value or default value

getValidateResponses

public boolean getValidateResponses()
Gets final validateResponses value.
  1. returns value of corresponding attribute if it is not null
  2. returns default value if parent of this itemSessionControl is TestPart
  3. returns parent's final validateResponse value (parent must be SectionPart)

Returns:
final validateResponses value

getParentsValidateResponses

protected boolean getParentsValidateResponses()
Gets parent's (parent of parent of this itemSessionControl) final validateResponses value or default value if parent of this itemSessionControl is TestPart.

Returns:
parent's final validateResponses value or default value


Copyright © 2009. All Rights Reserved.