Bienvenido, Invitado
Recordarme

TEMA:

Math captcha with "refresh" button? 1 año 2 meses antes #264052

  • Autor del tema
  • ellen
  • Fuera de línea
  • Junior Breezer
  • Junior Breezer
  • Mensajes: 67
  • Gracias recibidas: 0
Hi,
I`m using math captcha in my forms, `cause the normal bf captcha is unreadable too often for users.
Now some users told me, that the form couldn`t be send even if the the right answer was given ( f.e. 4+1=5).
I modified the script a little bit, because not every german user understands the english written numbers (one, two...), so I changed the numbers into 1,2,3...
In my own test it worked.
Could this change `cause the problems?

Is it possible to implement something like "refresh"?

/ MATH CAPTCHA CODE, DO NOT CHANGE

// if a captcha solve request comes in
if( JRequest::getVar('answer', null) !== null ){
   while (@ob_get_level() > 0) {
    @ob_end_clean();
   }
   $math = JFactory::getSession()->get('breezingforms.captcha.math','');
   if(trim($math) == ''){
     echo 0;
   } else {
     eval('if('.$math.' == '.JRequest::getInt('answer').'){ echo 1; } else { echo 0; }');
   }
   exit;
}

$this->execPieceByName('ff_InitLib');

$left = mt_rand(1,10);
$right = mt_rand(1,10);

$left_name = '';
switch( $left ){
   case 1: $left_name = '1'; break;
   case 2: $left_name = '2'; break;
   case 3: $left_name = '3'; break;
   case 4: $left_name = '4'; break;
   case 5: $left_name = '5'; break;
   case 6: $left_name = '6'; break;
   case 7: $left_name = '7'; break;
   case 8: $left_name = '8'; break;
   case 9: $left_name = '9'; break;
   case 10: $left_name = '10'; break;
}

$right_name = '';
switch( $right ){
   case 1: $right_name = '1'; break;
   case 2: $right_name = '2'; break;
   case 3: $right_name = '3'; break;
   case 4: $right_name = '4'; break;
   case 5: $right_name = '5'; break;
   case 6: $right_name = '6'; break;
   case 7: $right_name = '7'; break;
   case 8: $right_name = '8'; break;
   case 9: $right_name = '9'; break;
   case 10: $right_name = '10'; break;
}

$operand = mt_rand(0,1); // 0 = +, 1 = -1

// used for server side check later
JFactory::getSession()->set('breezingforms.captcha.math', $left . ' ' . ( $operand == 0 ? '+' : '-' ) . ' ' . $right);

ff_setValue('question', $left_name . ' ' . ( $operand == 0 ? '+' : '-' ) . ' ' . $right_name . '?');

// MATH CAPTCHA CODE END

the validation script
function ff_answer_validation(element, message)
{
    var myreturn = '';
    JQuery.ajaxSetup({async:false});
    JQuery.post('index.php', { option: 'com_breezingforms', ff_form: ff_processor.form, Itemid: 0, format: 'html', answer: element.value }, function(data){ if( data != '1' ){ message == '' ? myreturn = 'Please answer the question correctly!' : myreturn = message; } } );
    return myreturn;
} // ff_captcha_validation

Regards
Ellen

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Math captcha with "refresh" button? 1 año 2 meses antes #264053

  • Avatar de Mirec
  • Mirec
  • Fuera de línea
  • Ultimate Breezer
  • Ultimate Breezer
  • Mensajes: 3265
  • Karma: 2
  • Gracias recibidas: 160
Hi,

In my own test it worked.
Could this change `cause the problems?


If you are tested it and if works, then it work, I do not see any problem

Is it possible to implement something like "refresh"?

I need to investigate this and see what we can do.

When you said 'refresh' on what exactly do you mean, refresh Form after a click on the button or?

If you have more questions, feel free to ask!
Regards,
Mirko

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Última Edición: Post by Mirec.

Math captcha with "refresh" button? 1 año 2 meses antes #264057

  • Autor del tema
  • ellen
  • Fuera de línea
  • Junior Breezer
  • Junior Breezer
  • Mensajes: 67
  • Gracias recibidas: 0
Hi Mirko,

with "refresh" Button I mean only to refresh the arithmetic problem, not the whole form.
I don`t really think that this would solve the problem, but sometimes craziest things are possible :unsure:

If you are tested it and if works, then it work, I do not see any problem


I`ve tested it with 3 browsers, but only on win systems.

Maybe it`s caused by safari or mobile platforms or something like that, I don`t know.
I´ve got no information about the systems where it doesn`t work and I fear I will never get them.

Regards,
Ellen

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Math captcha with "refresh" button? 1 año 2 meses antes #264062

  • Avatar de Mirec
  • Mirec
  • Fuera de línea
  • Ultimate Breezer
  • Ultimate Breezer
  • Mensajes: 3265
  • Karma: 2
  • Gracias recibidas: 160
Hi,

with "refresh" Button I mean only to refresh the arithmetic problem, not the whole form.


I am afraid that is not possible, but I will investigate that and back to you as soon as possible, and as you said I think that it is not of big help.

Hmm, I know, maybe if a problem again appears that ask which system are they using? but, think that the system does not cause that, I think before that causes it a browser.

If you have more questions, feel free to ask!
Regards,
Mirko

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Math captcha with "refresh" button? 1 año 2 meses antes #264067

  • Autor del tema
  • ellen
  • Fuera de línea
  • Junior Breezer
  • Junior Breezer
  • Mensajes: 67
  • Gracias recibidas: 0
Hi Mirko,

thank you very much.

Unfortunately I have no direct contact to the users - It`s always a third party information - so, as I said, there will be no further information about the systems/browsers/configuration where it doesn`t work.

Have a nice day!

Regards,
Ellen

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Math captcha with "refresh" button? 1 año 2 meses antes #264068

  • Avatar de Mirec
  • Mirec
  • Fuera de línea
  • Ultimate Breezer
  • Ultimate Breezer
  • Mensajes: 3265
  • Karma: 2
  • Gracias recibidas: 160
Hi,

follow this FORM and you will see whether works well if causes a problem again, please back to us, and we will find another solution that works!

Have a nice day, too!
If you have more questions, feel free to ask!

Regards,
Mirko

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

  • Página:
  • 1
  • 2
Tiempo de carga de la página: 0.052 segundos