You are here

function _math_captcha_repr_op in CAPTCHA Pack 6

Same name and namespace in other branches
  1. 8 math_captcha/math_captcha.challenge.inc \_math_captcha_repr_op()
  2. 5 math_captcha/math_captcha.module \_math_captcha_repr_op()
  3. 7 math_captcha/math_captcha.challenge.inc \_math_captcha_repr_op()
1 call to _math_captcha_repr_op()
_math_captcha_build_captcha in math_captcha/math_captcha.challenge.inc
helper function to build a math CAPTCHA form item

File

math_captcha/math_captcha.challenge.inc, line 113

Code

function _math_captcha_repr_op($op) {

  // start with no textual representation
  $t = "{$op}";

  // if enabled and available: do textual representation
  if (variable_get('math_captcha_textual_operators', FALSE)) {
    $repr_map = array(
      '+' => t('plus'),
      '-' => t('minus'),
      '*' => t('times'),
      '=' => t('equals'),
    );
    if (array_key_exists($op, $repr_map)) {
      $t = $repr_map[$op];
    }
  }
  return $t;
}