|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.qtitools.qti.node.AbstractNode
org.qtitools.qti.node.AbstractObject
org.qtitools.qti.node.test.TemplateDefault
public class TemplateDefault
The default value of A template variable in an item can be overridden based on the test context in which the template is instantiated. The value is obtained by evaluating an expression defined within the reference to the item at test level and which may therefore depend on the values of variables taken from other items in the test or from outcomes defined at test level itself.
| Field Summary | |
|---|---|
static java.lang.String |
ATTR_TEMPLATE_IDENTIFIER_NAME
Name of templateIdentifier attribute in xml schema. |
static java.lang.String |
CLASS_TAG
Name of this class in xml schema. |
| Fields inherited from interface org.qtitools.qti.node.XmlNode |
|---|
INDENT, NEW_LINE, SIMPLE_NAME_INNER_SEPARATOR, SIMPLE_NAMES_SEPARATOR |
| Constructor Summary | |
|---|---|
TemplateDefault(AssessmentItemRef parent)
Constructs object. |
|
| Method Summary | |
|---|---|
Value |
evaluate()
Evaluates this object. |
java.lang.String |
getClassTag()
Gets QTI class name of this node. |
Expression |
getExpression()
Gets expression child. |
AssessmentItemRef |
getParent()
Gets parent of this node or null (if node is root; for example AssessmentTest). |
BaseType[] |
getRequiredBaseTypes(int index)
Gets list of all acceptable baseTypes which can child expression at given position produce. |
Cardinality[] |
getRequiredCardinalities(int index)
Gets list of all acceptable cardinalities which can child expression at given position produce. |
java.lang.String |
getTemplateIdentifier()
Gets value of templateIdentifier attribute. |
Value |
getValue()
Gets last result of evaluation or null if this object was not evaluated yet. |
void |
setExpression(Expression expression)
Sets new expression child. |
void |
setTemplateIdentifier(java.lang.String templateIdentifier)
Sets new value of templateIdentifier attribute. |
| 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, 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.XmlObject |
|---|
getParentItem, getParentResult, getParentTest, setParent |
| 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 |
|---|
public static final java.lang.String CLASS_TAG
public static final java.lang.String ATTR_TEMPLATE_IDENTIFIER_NAME
| Constructor Detail |
|---|
public TemplateDefault(AssessmentItemRef parent)
parent - parent of created object| Method Detail |
|---|
public java.lang.String getClassTag()
XmlNodeQTI class name has very important role during loading/saving nodes.
For example: Java class name is AssessmentTest; QTI class name is assessmentTest.
getClassTag in interface XmlNodegetClassTag in class AbstractNodepublic AssessmentItemRef getParent()
XmlNodeWhile 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).
getParent in interface XmlNodegetParent in interface XmlObjectgetParent in class AbstractObjectpublic java.lang.String getTemplateIdentifier()
setTemplateIdentifier(java.lang.String)public void setTemplateIdentifier(java.lang.String templateIdentifier)
templateIdentifier - new value of templateIdentifier attributegetTemplateIdentifier()public Expression getExpression()
setExpression(org.qtitools.qti.node.expression.Expression)public void setExpression(Expression expression)
expression - new expression childgetExpression()public Cardinality[] getRequiredCardinalities(int index)
ExpressionParentFor example delete expression returns single cardinality for index 0 and list of multiple and ordered cardinality for index 1.
Result of this method can change in time.
Static example is expression or. Expression or accepts only single cardinality for any index.
Dynamic example is expression match. Expression match accepts any cardinality of its children, but this cardinality must be same for all its children.
getRequiredCardinalities in interface ExpressionParentindex - position of child expression in this parent
public BaseType[] getRequiredBaseTypes(int index)
ExpressionParentResult of this method can change in time.
Static example is expression or. Expression or accepts only boolean baseType for any index.
Dynamic example is expression match. Expression match accepts any baseType of its children. but this baseType must be same for all its children.
getRequiredBaseTypes in interface ExpressionParentindex - position of child expression in this parent
public Value evaluate()
public Value getValue()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||