public interface AuthorAnswer extends Serializable
comparison
assertion,
the weight (grade assigned to this answer when correct) and may contain some additional
validation
assertions.Modifier and Type | Method and Description |
---|---|
Validation |
addNewValidation(ValidationName name)
Adds a new validation assertion that the student's answer has to fulfill in order to be correct.
|
AuthorAnswer |
copy(AuthorAnswer model) |
Comparison |
getComparison()
Gets the comparison assertion that is to be used to compare the student's answer to
getValue() . |
java.lang.String |
getFilterableValue()
Returns the value of the correct answer defined by this author answer in a format suitable for
MathFilter.filter(String) to render it. |
Validation |
getValidation(ValidationName name)
Get the validation assertion for a given validation type.
|
Validation[] |
getValidations()
Gets the additional validation assertions that the student's answer must fulfill to be correct.
|
java.lang.String |
getValue()
Returns the value that the student's answer will be compared to using the
Comparison assertion. |
java.lang.String |
getValueAsMathML() |
double |
getWeight()
Gets the weight of this author answer, i.e., the grad scored when an answer is correct according
to the criteria contained in this author answer.
|
void |
removeValidation(Validation validation)
Removes a given validation from the set of validations in this author answer.
|
Comparison |
setComparison(ComparisonName name)
Sets the type of comparison that will be used to compare the student's answer to
getValue() . |
void |
setValue(java.lang.String value)
Sets the value that the student's answer will be compared to using the
Comparison assertion. |
void |
setWeight(double weight)
Gets the weight of this author answer, i.e., the grad scored when an answer is correct according
to the criteria contained in this author answer.
|
serialize
java.lang.String getValue()
Comparison
assertion.java.lang.String getFilterableValue()
MathFilter.filter(String)
to render it.void setValue(java.lang.String value)
Comparison
assertion.value
- The desired correct answer value. It can be MathML, plain text or a graphical construction.Comparison setComparison(ComparisonName name)
getValue()
.name
- The comparison name. If it is null or it is the current one, it does nothing.Comparison getComparison()
getValue()
.Validation[] getValidations()
Validation addNewValidation(ValidationName name)
name
- The name of the validation assertion to be added. If it is null or this validation already exists
does nothing.getValidation(ValidationName)
}.Validation getValidation(ValidationName name)
name
- The desired validation type.void removeValidation(Validation validation)
validation
- The validation assertion to be removed. It must be the actual validation object
from this author answer, it does not suffice for it to have the same type as the
validation to be removed.double getWeight()
void setWeight(double weight)
weight
- The desired weight. It must be a double between 0.0 (minimum score) and 1.0 (maximum score).AuthorAnswer copy(AuthorAnswer model)
model
- java.lang.String getValueAsMathML()
Copyright © 2021 Maths for More S.L. All Rights Reserved.