\MathSpamProtection
Tools for adding an optional Maths protection question to a form.
Synopsis
class MathSpamProtection
{
- // members
- private static boolean $mathProtection = false;
- // methods
- public static String getMathQuestion()
- public static void correctAnswer()
- public static void digitToWord()
- public static void isEnabled()
- public static void setEnabled()
Members
private
- $mathProtection
Methods
public
- correctAnswer() — Checks the given answer if it matches the addition of the saved session variables. Users can answer using words or digits.
- digitToWord() — Helper method for converting digits to their equivelant english words
- getMathQuestion() — Creates the question from random variables, which are also saved to the session.
- isEnabled()
- setEnabled()