equivSyntax Draft

Overview

equivSyntax compares a LaTeX string against a syntax pattern specified in 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

  • Rule

    Select the syntax rule to match students response against.

  • Argument

    Select the syntax rule argument if needed.




Examples

Basic equivSyntax scoring.

In this example, any response given in the form of a decimal fraction with 3 decimal places will be correct. The Rule option is set to "decimal" and Argument is set to "\(3\)".

AnswerMarking
\(1.000\)true
\(5.000\)true
\(2.165\)true
\(3.14\)false
\(1\)false
\(\frac{1}{2}\)false

Source
{
    "instant_feedback": true,
    "is_math": true,
    "stimulus": "<p>Enter any decimal rounded to the thousandth place.<\/p>\n",
    "type": "formulaV2",
    "ui_style": {
        "type": "block-on-focus-keyboard"
    },
    "validation": {
        "scoring_type": "exactMatch",
        "valid_response": {
            "score": 1,
            "value": [
                {
                    "method": "equivSyntax",
                    "options": {
                        "inverseResult": false,
                        "decimalPlaces": 10,
                        "syntax": "\\decimal",
                        "argument": 3
                    }
                }
            ]
        }
    }
}

Combining Methods

In this example, equivSyntax Rule is set to "simple fraction" and equivSymbolic is added in order to constrain possible correct responses. equivSymbolic valid response is set to \(0.5\).

AnswerMarking
\(\frac{1}{2}\)true
\(\frac{2}{4}\)true
\(\frac{50}{100}\)true
\(0.5\)false
\(50%\)false

Source
{
    "instant_feedback": true,
    "is_math": true,
    "stimulus": "<p>Rewrite \\(0.5\\) as a simple fraction.<\/p>\n",
    "type": "formulaV2",
    "ui_style": {
        "type": "block-on-focus-keyboard"
    },
    "validation": {
        "scoring_type": "exactMatch",
        "valid_response": {
            "score": 1,
            "value": [
                {
                    "method": "equivSyntax",
                    "options": {
                        "inverseResult": false,
                        "decimalPlaces": 10,
                        "syntax": "\\simpleFraction"
                    }
                },
                {
                    "method": "equivSymbolic",
                    "value": "0.5",
                    "options": {
                        "inverseResult": false,
                        "decimalPlaces": 10
                    }
                }
            ]
        }
    }
}