|
||||||||||
| 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.expression.AbstractExpression
org.qtitools.qti.node.expression.operator.Equal
public class Equal
The equal operator takes two sub-expressions which must both have single cardinality and have A numerical base-type. The result is A single boolean with A value of true if the two expressions are numerically equal and false if they are not. If either sub-expression is NULL then the operator results in NULL.
Attribute : toleranceMode [1]: toleranceMode = exact
When comparing two floating point numbers for equality it is often desirable to have A tolerance to ensure that spurious errors in scoring are not introduced by rounding errors. The tolerance mode determines whether the comparison is done exactly, using an absolute range or A relative range.
Attribute : tolerance [0..2]: floatOrTemplateRef
If the tolerance mode is absolute or relative then the tolerance must be specified. The tolerance consists of two positive numbers, t0 and t1, that define the lower and upper bounds. If only one value is given it is used for both.
In absolute mode the result of the comparison is true if the value of the second expression, y is within the following range defined by the first value, x.
x-t0,x+t1
In relative mode, t0 and t1 are treated as percentages and the following range is used instead.
x*(1-t0/100),x*(1+t1/100)
Attribute : includeLowerBound [0..1]: boolean = true
Controls whether or not the lower bound is included in the comparison
Attribute : includeUpperBound [0..1]: boolean = true
Controls whether or not the upper bound is included in the comparison
Cardinality,
BaseType,
Serialized Form| Field Summary | |
|---|---|
static boolean |
ATTR_INCLUDE_LOWER_BOUND_DEFAULT_VALUE
Default value of includeLowerBound attribute. |
static java.lang.String |
ATTR_INCLUDE_LOWER_BOUND_NAME
Name of includeLowerBound attribute in xml schema. |
static boolean |
ATTR_INCLUDE_UPPER_BOUND_DEFAULT_VALUE
Default value of incluseUpperBound attribute. |
static java.lang.String |
ATTR_INCLUDE_UPPER_BOUND_NAME
Name of includeUpperBound attribute in xml schema. |
static java.lang.String |
ATTR_TOLERANCE_MODE_NAME
Name of toleranceMode attribute in xml schema. |
static java.util.List<java.lang.Double> |
ATTR_TOLERANCES_DEFAULT_VALUE
Default value of tolerance attribute. |
static java.lang.String |
ATTR_TOLERANCES_NAME
Name of tolerance attribute in xml schema. |
static java.lang.String |
CLASS_TAG
Name of this class in xml schema. |
| Fields inherited from class org.qtitools.qti.node.expression.AbstractExpression |
|---|
logger |
| Fields inherited from interface org.qtitools.qti.node.expression.Expression |
|---|
DISPLAY_NAME |
| Fields inherited from interface org.qtitools.qti.node.XmlNode |
|---|
INDENT, NEW_LINE, SIMPLE_NAME_INNER_SEPARATOR, SIMPLE_NAMES_SEPARATOR |
| Constructor Summary | |
|---|---|
Equal(ExpressionParent parent)
Constructs expression. |
|
| Method Summary | |
|---|---|
protected Value |
evaluateSelf(int depth)
Evaluates this expression. |
java.lang.String |
getClassTag()
Gets QTI class name of this node. |
protected double |
getFirstTolerance()
Gets first tolerance if defined; zero otherwise. |
java.lang.Boolean |
getIncludeLowerBound()
Gets value of includeLowerBound attribute. |
java.lang.Boolean |
getIncludeUpperBound()
Gets value of includeUpperBound attribute. |
protected double |
getSecondTolerance()
Gets second tolerance if defined; first tolerance otherwise. |
ToleranceMode |
getToleranceMode()
Gets value of toleranceMode attribute. |
java.util.List<java.lang.Double> |
getTolerances()
Gets value of tolerance attribute. |
void |
setIncludeLowerBound(java.lang.Boolean includeLowerBound)
Sets new value of includeLowerBound attribute. |
void |
setIncludeUpperBound(java.lang.Boolean includeUpperBound)
Sets new value of includeUpperBound attribute. |
void |
setToleranceMode(ToleranceMode toleranceMode)
Sets new value of toleranceMode attribute. |
protected ValidationResult |
validateAttributes()
Validates attributes of this node. |
| Methods inherited from class org.qtitools.qti.node.expression.AbstractExpression |
|---|
evaluate, getBaseType, getCardinality, getChildren, getFirstChild, getParent, getParentRequiredBaseTypes, getParentRequiredCardinalities, getProducedBaseTypes, getProducedCardinalities, getProducedNumericalBaseTypes, getRequiredBaseTypes, getRequiredCardinalities, getRequiredSameBaseTypes, getRequiredSameCardinalities, getSecondChild, getType, getValue, isAnyChildNull, isNull, isVariable, reset, toString, validate |
| 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, validateChildren |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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 |
| Field Detail |
|---|
public static final java.lang.String CLASS_TAG
public static final java.lang.String ATTR_TOLERANCE_MODE_NAME
public static final java.lang.String ATTR_TOLERANCES_NAME
public static final java.util.List<java.lang.Double> ATTR_TOLERANCES_DEFAULT_VALUE
public static final java.lang.String ATTR_INCLUDE_LOWER_BOUND_NAME
public static final boolean ATTR_INCLUDE_LOWER_BOUND_DEFAULT_VALUE
public static final java.lang.String ATTR_INCLUDE_UPPER_BOUND_NAME
public static final boolean ATTR_INCLUDE_UPPER_BOUND_DEFAULT_VALUE
| Constructor Detail |
|---|
public Equal(ExpressionParent parent)
parent - parent of this expression| 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 ToleranceMode getToleranceMode()
setToleranceMode(org.qtitools.qti.node.expression.operator.ToleranceMode)public void setToleranceMode(ToleranceMode toleranceMode)
toleranceMode - new value of toleranceMode attributegetToleranceMode()public java.util.List<java.lang.Double> getTolerances()
protected double getFirstTolerance()
protected double getSecondTolerance()
public java.lang.Boolean getIncludeLowerBound()
setIncludeLowerBound(java.lang.Boolean)public void setIncludeLowerBound(java.lang.Boolean includeLowerBound)
includeLowerBound - new value of includeLowerBound attributegetIncludeLowerBound()public java.lang.Boolean getIncludeUpperBound()
setIncludeUpperBound(java.lang.Boolean)public void setIncludeUpperBound(java.lang.Boolean includeUpperBound)
includeUpperBound - new value of includeUpperBound attributegetIncludeUpperBound()protected ValidationResult validateAttributes()
AbstractNode
validateAttributes in class AbstractNodeprotected Value evaluateSelf(int depth)
AbstractExpression
evaluateSelf in class AbstractExpressiondepth - depth of this expression in expression tree (root's depth = 0)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||