org.qtitools.qti.node.item
Class AssessmentItem

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

public class AssessmentItem
extends UniqueObject

AssessmentItem encompasses the information that is presented to A candidate and information about how to score the item. Scoring takes place when candidate responses are transformed into outcomes by response processing rules. It is sometimes desirable to have several different items that appear the same to the candidate but which are scored differently. In this specification, these are distinct items by definition and must therefore have distinct identifiers.

Author:
Jonathon Hare, Jiri Kajaba
See Also:
Serialized Form

Field Summary
static java.lang.String ATTR_ADAPTIVE_NAME
          Name of adaptive attribute in xml schema.
static java.lang.String ATTR_DEFAULT_NAME_SPACE_NAME
          Name of xmlns attribute in xml schema.
static java.lang.String ATTR_DEFAULT_NAME_SPACE_VALUE
          Value of xmlns attribute.
static java.lang.String ATTR_LABEL_DEFAULT_VALUE
          Default value of label attribute.
static java.lang.String ATTR_LABEL_NAME
          Name of label attribute in xml schema.
static java.lang.String ATTR_LANG_DEFAULT_VALUE
          Default value of lang attribute.
static java.lang.String ATTR_LANG_NAME
          Name of lang attribute in xml schema.
static java.lang.String ATTR_TIME_DEPENDENT_NAME
          Name of timeDependant attribute in xml schema.
static java.lang.String ATTR_TITLE_NAME
          Name of title attribute in xml schema.
static java.lang.String ATTR_TOOL_NAME_DEFAULT_VALUE
          Default value of toolName attribute.
static java.lang.String ATTR_TOOL_NAME_NAME
          Name of toolName attribute in xml schema.
static java.lang.String ATTR_TOOL_VERSION_DEFAULT_VALUE
          Default value of toolVersion attribute.
static java.lang.String ATTR_TOOL_VERSION_NAME
          Name of toolVersion attribute in xml schema.
static java.lang.String ATTR_XSI_NAME_SPACE_NAME
          Name of xmlns:xsi attribute in xml schema.
static java.lang.String ATTR_XSI_NAME_SPACE_VALUE
          Value of xmlns:xsi attribute.
static java.lang.String ATTR_XSI_SCHEMA_LOCATION_NAME
          Name of xsi:schemaLocation attribute in xml schema.
static java.lang.String ATTR_XSI_SCHEMA_LOCATION_VALUE
          Value of xsi:schemaLocation attribute.
static java.lang.String CLASS_TAG
          Name of this class in xml schema.
protected static org.slf4j.Logger logger
          logger.
static java.lang.String VALUE_ITEM_IS_COMPLETED
          Value of completion status built-in variable.
static java.lang.String VALUE_ITEM_IS_NOT_ATTEMPTED
          Value of completion status built-in variable.
static java.lang.String VALUE_ITEM_IS_UNKNOWN
          Value of completion status built-in variable.
static java.lang.String VARIABLE_COMPLETION_STATUS
          Name of completion status built-in variable.
static java.lang.String VARIABLE_DURATION_NAME
          Name of duration built-in variable.
static java.lang.String VARIABLE_NUMBER_OF_ATTEMPTS
          Name of number of attempts built-in variable.
static java.lang.String XML
          Header of xml file.
 
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
AssessmentItem()
          Constructs assessmentItem.
AssessmentItem(java.lang.String identifier, java.lang.String title, boolean adaptive, boolean timeDependent)
          Convenience constructor for assessmentItem.
 
Method Summary
 int countCorrect()
          Returns the number of correct responses
 int countIncorrect()
          Returns the number of incorrect responses
 java.lang.Boolean getAdaptive()
          Gets value of adaptive attribute.
 java.lang.String getClassTag()
          Gets QTI class name of this node.
 ItemBody getItemBody()
          Gets itemBody child.
 java.lang.String getLabel()
          Gets value of label attribute.
 java.lang.String getLang()
          Gets value of lang attribute.
 java.util.List<ModalFeedback> getModalFeedbacks()
          Gets modalFeedback children.
 OutcomeDeclaration getOutcomeDeclaration(java.lang.String identifier)
          Gets outcomeDeclaration with given identifier or null.
 java.util.List<OutcomeDeclaration> getOutcomeDeclarations()
          Gets outcomeDeclaration children.
 Value getOutcomeValue(java.lang.String identifier)
          Gets value of outcomeDeclaration with given identifier or null.
 java.util.Map<java.lang.String,Value> getOutcomeValues()
          Returns an unmodifiable map of outcome identifiers to outcome values.
 ResponseDeclaration getResponseDeclaration(java.lang.String identifier)
          Gets responseDeclaration with given identifier or null.
 java.util.List<ResponseDeclaration> getResponseDeclarations()
          Gets responseDeclaration children.
 ResponseProcessing getResponseProcessing()
          Gets responseProcessing child.
 Value getResponseValue(java.lang.String identifier)
          Gets A response variable with given identifier or null
 java.util.Map<java.lang.String,Value> getResponseValues()
          Returns an unmodifiable map of response identifiers to response values.
 java.util.List<Stylesheet> getStylesheets()
          Gets stylesheet children.
 TemplateDeclaration getTemplateDeclaration(java.lang.String identifier)
          Gets templateDeclaration with given identifier or null.
 java.util.List<TemplateDeclaration> getTemplateDeclarations()
          Gets templateDeclaration children.
 TemplateProcessing getTemplateProcessing()
          Gets templateProcessing child.
 Value getTemplateValue(java.lang.String identifier)
          Gets value of templateDeclaration with given identifier or null.
 java.util.Map<java.lang.String,Value> getTemplateValues()
          Returns an unmodifiable map of template identifiers to template values.
 java.lang.Boolean getTimeDependent()
          Gets value of timeDependent attribute.
 ItemTimeRecord getTimeRecord()
          Gets time record of this item.
 java.lang.String getTitle()
          Gets value of title attribute.
 java.lang.String getToolName()
          Gets value of toolName attribute.
 java.lang.String getToolVersion()
          Gets value of toolVersion attribute.
 Value getValue(java.lang.String identifier)
          Gets A template or outcome variable with given identifier or null
 void initialize(java.util.List<TemplateDefault> templateDefaults)
          Initialize the item by setting the template defaults, resetting variables, and performing templateProcessing An item should only be initialized if it is going to be rendered/presented
 java.lang.Boolean isCorrect()
          Returns true if this item reference was correctly responded; Correctly responded means ALL defined responseVars match their associated correctResponse.
 java.lang.Boolean isIncorrect()
          Returns true if this item reference was incorrectly responded; Incorrectly responded means ANY defined responseVars didn't match their associated correctResponse.
 void processResponses()
          Process the responses
 void setAdaptive(java.lang.Boolean adaptive)
          Sets new value of adaptive attribute.
 void setCompletionStatus(java.lang.String completionStatus)
          Set the completionStatus to the given value.
 void setItemBody(ItemBody itemBody)
          Sets new itemBody child.
 void setLabel(java.lang.String label)
          Sets new value of label attribute.
 void setLang(java.lang.String lang)
          Sets new value of lang attribute.
 void setResponseProcessing(ResponseProcessing responseProcessing)
          Sets new responseProcessing child.
 void setResponses(java.util.Map<java.lang.String,java.util.List<java.lang.String>> responses)
          Set the responses for this assessmentItem.
 void setTemplateProcessing(TemplateProcessing templateProcessing)
          Sets new templateProcessing child.
 void setTimeDependent(java.lang.Boolean timeDependent)
          Sets new value of timeDependent attribute.
 void setTimeRecord(ItemTimeRecord timeRecord)
          Sets time record of this item.
 void setTitle(java.lang.String title)
          Sets new value of title attribute.
 void setToolName(java.lang.String toolName)
          Sets new value of toolName attribute.
 void setToolVersion(java.lang.String toolVersion)
          Sets new value of toolVersion attribute.
 java.lang.String toXmlString(int depth, boolean printDefaultAttributes)
          Prints this node and all its children into string.
 boolean validateResponses()
          Validate the responses set for each of the interactions
 
Methods inherited from class org.qtitools.qti.node.UniqueObject
getIdentifier, getSimpleName, setIdentifier, validateAttributes
 
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, getSourceFile, getSourceNode, getSourceString, getSourceUrl, hasChildNodes, load, load, load, load, loadAttributes, readChild, readChildren, setParent, setSourceFile, setSourceNode, setSourceString, setSourceUrl, 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, getFullName, getNodeGroups, getParentRoot, 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

logger

protected static org.slf4j.Logger logger
logger.


CLASS_TAG

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

See Also:
Constant Field Values

XML

public static final java.lang.String XML
Header of xml file.

See Also:
Constant Field Values

ATTR_DEFAULT_NAME_SPACE_NAME

public static final java.lang.String ATTR_DEFAULT_NAME_SPACE_NAME
Name of xmlns attribute in xml schema.

See Also:
Constant Field Values

ATTR_DEFAULT_NAME_SPACE_VALUE

public static final java.lang.String ATTR_DEFAULT_NAME_SPACE_VALUE
Value of xmlns attribute.

See Also:
Constant Field Values

ATTR_XSI_NAME_SPACE_NAME

public static final java.lang.String ATTR_XSI_NAME_SPACE_NAME
Name of xmlns:xsi attribute in xml schema.

See Also:
Constant Field Values

ATTR_XSI_NAME_SPACE_VALUE

public static final java.lang.String ATTR_XSI_NAME_SPACE_VALUE
Value of xmlns:xsi attribute.

See Also:
Constant Field Values

ATTR_XSI_SCHEMA_LOCATION_NAME

public static final java.lang.String ATTR_XSI_SCHEMA_LOCATION_NAME
Name of xsi:schemaLocation attribute in xml schema.

See Also:
Constant Field Values

ATTR_XSI_SCHEMA_LOCATION_VALUE

public static final java.lang.String ATTR_XSI_SCHEMA_LOCATION_VALUE
Value of xsi:schemaLocation attribute.

See Also:
Constant Field Values

ATTR_TITLE_NAME

public static final java.lang.String ATTR_TITLE_NAME
Name of title attribute in xml schema.

See Also:
Constant Field Values

ATTR_LABEL_NAME

public static final java.lang.String ATTR_LABEL_NAME
Name of label attribute in xml schema.

See Also:
Constant Field Values

ATTR_LABEL_DEFAULT_VALUE

public static final java.lang.String ATTR_LABEL_DEFAULT_VALUE
Default value of label attribute.


ATTR_LANG_NAME

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

See Also:
Constant Field Values

ATTR_LANG_DEFAULT_VALUE

public static final java.lang.String ATTR_LANG_DEFAULT_VALUE
Default value of lang attribute.


ATTR_ADAPTIVE_NAME

public static final java.lang.String ATTR_ADAPTIVE_NAME
Name of adaptive attribute in xml schema.

See Also:
Constant Field Values

ATTR_TIME_DEPENDENT_NAME

public static final java.lang.String ATTR_TIME_DEPENDENT_NAME
Name of timeDependant attribute in xml schema.

See Also:
Constant Field Values

ATTR_TOOL_NAME_NAME

public static final java.lang.String ATTR_TOOL_NAME_NAME
Name of toolName attribute in xml schema.

See Also:
Constant Field Values

ATTR_TOOL_NAME_DEFAULT_VALUE

public static final java.lang.String ATTR_TOOL_NAME_DEFAULT_VALUE
Default value of toolName attribute.


ATTR_TOOL_VERSION_NAME

public static final java.lang.String ATTR_TOOL_VERSION_NAME
Name of toolVersion attribute in xml schema.

See Also:
Constant Field Values

ATTR_TOOL_VERSION_DEFAULT_VALUE

public static final java.lang.String ATTR_TOOL_VERSION_DEFAULT_VALUE
Default value of toolVersion attribute.


VARIABLE_COMPLETION_STATUS

public static final java.lang.String VARIABLE_COMPLETION_STATUS
Name of completion status built-in variable.

See Also:
Constant Field Values

VALUE_ITEM_IS_NOT_ATTEMPTED

public static final java.lang.String VALUE_ITEM_IS_NOT_ATTEMPTED
Value of completion status built-in variable.

See Also:
Constant Field Values

VALUE_ITEM_IS_UNKNOWN

public static final java.lang.String VALUE_ITEM_IS_UNKNOWN
Value of completion status built-in variable.

See Also:
Constant Field Values

VALUE_ITEM_IS_COMPLETED

public static final java.lang.String VALUE_ITEM_IS_COMPLETED
Value of completion status built-in variable.

See Also:
Constant Field Values

VARIABLE_NUMBER_OF_ATTEMPTS

public static final java.lang.String VARIABLE_NUMBER_OF_ATTEMPTS
Name of number of attempts built-in variable.

See Also:
Constant Field Values

VARIABLE_DURATION_NAME

public static final java.lang.String VARIABLE_DURATION_NAME
Name of duration built-in variable.

See Also:
Constant Field Values
Constructor Detail

AssessmentItem

public AssessmentItem()
Constructs assessmentItem.


AssessmentItem

public AssessmentItem(java.lang.String identifier,
                      java.lang.String title,
                      boolean adaptive,
                      boolean timeDependent)
Convenience constructor for assessmentItem. Sets the JQTI toolName and toolVersion automatically.

Parameters:
identifier - Value of the identifier attribute.
title - Value of the title attribute.
adaptive - Value of the adaptive attribute.
timeDependent - Value of the timeDependent attribute.
Method Detail

getTimeRecord

public ItemTimeRecord getTimeRecord()
Gets time record of this item.

Returns:
time record of this item

setTimeRecord

public void setTimeRecord(ItemTimeRecord timeRecord)
Sets time record of this item.

Parameters:
timeRecord - timeRecord to set

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

getTitle

public java.lang.String getTitle()
Gets value of title attribute.

Returns:
value of title attribute
See Also:
setTitle(java.lang.String)

setTitle

public void setTitle(java.lang.String title)
Sets new value of title attribute.

Parameters:
title - new value of title attribute
See Also:
getTitle()

getLabel

public java.lang.String getLabel()
Gets value of label attribute.

Returns:
value of label attribute
See Also:
setLabel(java.lang.String)

setLabel

public void setLabel(java.lang.String label)
Sets new value of label attribute.

Parameters:
label - new value of label attribute
See Also:
getLabel()

getLang

public java.lang.String getLang()
Gets value of lang attribute.

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

setLang

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

Parameters:
lang - new value of lang attribute
See Also:
getLang()

getAdaptive

public java.lang.Boolean getAdaptive()
Gets value of adaptive attribute.

Returns:
value of adaptive attribute
See Also:
setAdaptive(java.lang.Boolean)

setAdaptive

public void setAdaptive(java.lang.Boolean adaptive)
Sets new value of adaptive attribute.

Parameters:
adaptive - new value of adaptive attribute
See Also:
getAdaptive()

getTimeDependent

public java.lang.Boolean getTimeDependent()
Gets value of timeDependent attribute.

Returns:
value of timeDependent attribute
See Also:
setTimeDependent(java.lang.Boolean)

setTimeDependent

public void setTimeDependent(java.lang.Boolean timeDependent)
Sets new value of timeDependent attribute.

Parameters:
timeDependent - new value of timeDependent attribute
See Also:
getTimeDependent()

getToolName

public java.lang.String getToolName()
Gets value of toolName attribute.

Returns:
value of toolName attribute
See Also:
setToolName(java.lang.String)

setToolName

public void setToolName(java.lang.String toolName)
Sets new value of toolName attribute.

Parameters:
toolName - new value of toolName attribute
See Also:
getToolName()

getToolVersion

public java.lang.String getToolVersion()
Gets value of toolVersion attribute.

Returns:
value of toolVersion attribute
See Also:
setToolVersion(java.lang.String)

setToolVersion

public void setToolVersion(java.lang.String toolVersion)
Sets new value of toolVersion attribute.

Parameters:
toolVersion - new value of toolVersion attribute
See Also:
getToolVersion()

getStylesheets

public java.util.List<Stylesheet> getStylesheets()
Gets stylesheet children.

Returns:
stylesheet children

getModalFeedbacks

public java.util.List<ModalFeedback> getModalFeedbacks()
Gets modalFeedback children.

Returns:
modalFeedback children

getOutcomeDeclarations

public java.util.List<OutcomeDeclaration> getOutcomeDeclarations()
Gets outcomeDeclaration children.

Returns:
outcomeDeclaration children

getOutcomeDeclaration

public OutcomeDeclaration getOutcomeDeclaration(java.lang.String identifier)
Gets outcomeDeclaration with given identifier or null.

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

setCompletionStatus

public void setCompletionStatus(java.lang.String completionStatus)
Set the completionStatus to the given value.

Parameters:
completionStatus - value to set

getResponseDeclarations

public java.util.List<ResponseDeclaration> getResponseDeclarations()
Gets responseDeclaration children.

Returns:
responseDeclaration children

getResponseDeclaration

public ResponseDeclaration getResponseDeclaration(java.lang.String identifier)
Gets responseDeclaration with given identifier or null.

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

getTemplateDeclarations

public java.util.List<TemplateDeclaration> getTemplateDeclarations()
Gets templateDeclaration children.

Returns:
templateDeclaration children

getTemplateDeclaration

public TemplateDeclaration getTemplateDeclaration(java.lang.String identifier)
Gets templateDeclaration with given identifier or null.

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

getTemplateProcessing

public TemplateProcessing getTemplateProcessing()
Gets templateProcessing child.

Returns:
templateProcessing child
See Also:
setTemplateProcessing(org.qtitools.qti.node.item.template.processing.TemplateProcessing)

setTemplateProcessing

public void setTemplateProcessing(TemplateProcessing templateProcessing)
Sets new templateProcessing child.

Parameters:
templateProcessing - new templateProcessing child
See Also:
getTemplateProcessing()

getResponseProcessing

public ResponseProcessing getResponseProcessing()
Gets responseProcessing child.

Returns:
templateProcessing child
See Also:
setTemplateProcessing(org.qtitools.qti.node.item.template.processing.TemplateProcessing)

setResponseProcessing

public void setResponseProcessing(ResponseProcessing responseProcessing)
Sets new responseProcessing child.

Parameters:
responseProcessing - new responseProcessing child
See Also:
getResponseProcessing()

getItemBody

public ItemBody getItemBody()
Gets itemBody child.

Returns:
itemBody child
See Also:
setItemBody(org.qtitools.qti.node.content.ItemBody)

setItemBody

public void setItemBody(ItemBody itemBody)
Sets new itemBody child.

Parameters:
itemBody - new itemBody child
See Also:
getItemBody()

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

getValue

public Value getValue(java.lang.String identifier)
Gets A template or outcome variable with given identifier or null

Parameters:
identifier - given identifier
Returns:
value of templateDeclaration or outcomeDeclaration with given identifier or null

getResponseValue

public Value getResponseValue(java.lang.String identifier)
Gets A response variable with given identifier or null

Parameters:
identifier - given identifier
Returns:
value of responseDeclaration with given identifier or null

getTemplateValue

public Value getTemplateValue(java.lang.String identifier)
Gets value of templateDeclaration with given identifier or null.

Parameters:
identifier - given identifier
Returns:
value of templateDeclaration with given identifier or null

getOutcomeValue

public Value getOutcomeValue(java.lang.String identifier)
Gets value of outcomeDeclaration with given identifier or null.

Parameters:
identifier - given identifier
Returns:
value of outcomeDeclaration with given identifier or null

initialize

public void initialize(java.util.List<TemplateDefault> templateDefaults)
Initialize the item by setting the template defaults, resetting variables, and performing templateProcessing An item should only be initialized if it is going to be rendered/presented

Parameters:
templateDefaults - given templateDefaults values

setResponses

public void setResponses(java.util.Map<java.lang.String,java.util.List<java.lang.String>> responses)
Set the responses for this assessmentItem. The provided responses must be in the form responseIdentifier -> List of responses. If A given response is A singleValue, then the list will only have one element. Record cardinality responses are not supported!

Parameters:
responses - Responses to set.

processResponses

public void processResponses()
Process the responses


getOutcomeValues

public java.util.Map<java.lang.String,Value> getOutcomeValues()
Returns an unmodifiable map of outcome identifiers to outcome values.

Returns:
Unmodifiable map of outcome values.

getTemplateValues

public java.util.Map<java.lang.String,Value> getTemplateValues()
Returns an unmodifiable map of template identifiers to template values.

Returns:
Unmodifiable map of template values.

getResponseValues

public java.util.Map<java.lang.String,Value> getResponseValues()
Returns an unmodifiable map of response identifiers to response values.

Returns:
Unmodifiable map of response values.

validateResponses

public boolean validateResponses()
Validate the responses set for each of the interactions

Returns:
false if any interaction doesn't validate, true otherwise.

isCorrect

public java.lang.Boolean isCorrect()
Returns true if this item reference was correctly responded; Correctly responded means ALL defined responseVars match their associated correctResponse. Returns null if any of the responseDeclarations don't have correctResponses.

Returns:
true if this item reference was correctly responded; null if not all responseDeclarations contain correctResponses; false otherwise
See Also:
isIncorrect()

countCorrect

public int countCorrect()
Returns the number of correct responses

Returns:
the number of correct responses
See Also:
countIncorrect()

isIncorrect

public java.lang.Boolean isIncorrect()
Returns true if this item reference was incorrectly responded; Incorrectly responded means ANY defined responseVars didn't match their associated correctResponse. Returns null if any of the responseDeclarations don't have correctResponses.

Returns:
true if this item reference was incorrectly responded; null if not all responseDeclarations contain correctResponses; false otherwise
See Also:
isCorrect()

countIncorrect

public int countIncorrect()
Returns the number of incorrect responses

Returns:
the number of incorrect responses
See Also:
countIncorrect()


Copyright © 2009. All Rights Reserved.