Version: current

# Class MathSpamProtection

Tools for adding an optional Maths protection question to a form.

Package: cms\comments
Located at cms/code/sitefeatures/MathSpamProtection.php

## Methods summary

`public static String` | # `getMathQuestion( )` Creates the question from random variables, which are also saved to the session. Creates the question from random variables, which are also saved to the session. #### Returns `String` String
`public static` | # `correctAnswer( mixed $answer )` Checks the given answer if it matches the addition of the saved session variables. Users can answer using words or digits. Checks the given answer if it matches the addition of the saved session variables. Users can answer using words or digits.
`public static` | # `digitToWord( mixed $num )` Helper method for converting digits to their equivelant english words Helper method for converting digits to their equivelant english words
`public static` | # `isEnabled( )`
`public static` | # `setEnabled( mixed $math = true )`

### Magic methods summary

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -