equivSyntax
Overview
equivSyntax compares the learner response against a syntax pattern specified in the validation settings.
This method is a purely syntactic check and is unaffected by numeric values. Use equivSyntax as a supporting method in combination with equivSymbolic and equivValue to constrain possible response options.
Options
Ignore text
This refers to LaTeX text only, and when enabled will ignore any LaTeX text the student enters in the response area.
Rule
There are nine possible rules available. Some rules have an additional argument associated with them. Users can specify arguments to further define the desired correct answer. See examples below.
- Number - Any integer or floating point.
- Argument: Decimal places
- Integer - Any integer.
- Argument: Significant figures
- Decimal - Any decimal.
- Argument: Decimal places
- Scientific - Any number in scientific notation.
- Argument: Decimal places
- Variable - Any variable.
- Fraction - Any fraction, either a simple or mixed fraction.
- Mixed fraction - Any mixed fraction.
- Simple fraction - Any simple fraction.
- Fraction or decimal - A fraction or a decimal.
Rule |
Argument |
Input |
Result |
Number |
2 0.5 .5 .500 .834 1/2 |
true true true true true false |
|
Number |
1 |
0.5 .5 .500 |
true true false |
Integer |
5 0.50 1÷2 50% |
true false false false |
|
Integer |
3 |
100 1000 |
true false |
Decimal |
1.0 1.23 1. 1 |
true true true false |
|
Decimal |
3 |
1.000 1.234 1.2 |
true true false |
Scientific |
2 \times 10^3 1.2 \times 10^{-2} 10 \times 10^2 |
true true false |
|
Scientific |
2 |
2.34 \times 10^3 1.2 \times 10^{-2} |
true false |
Variable |
x y a b foo |
true true true true false |