The CAPTCHA API already got some overhaul for the 5.x-3.x branch (see http://drupal.org/node/158613).
But as time passes by and issues pop up, additional ideas emerge.
This issue thread is meant to discuss possible API extensions.

Here are some ideas already:

  • Add an option for CAPTCHA types to disable the CAPTCHA description. The CAPTCHA description is meant to explain to the user what a CAPTCHA is and why it should be solved. But it could be possible that a CAPTCHA type want to explain it itself, or want to hide it is a CAPTCHA to make it more effective. It should only be used when really necessary however. Use case: the gotcha CAPTCHA (see e.g. http://drupal.org/node/175181) does have to look like a normal form element.
  • Add support for multi widget CAPTCHA types (see http://drupal.org/node/169132). The CAPTCHA API now only allows validation of one form element 'captcha_response', while future challenges could want to use a textfield and selection list. Possible ways of putting this in the API are: changing the preprocess operation in hook_captcha (as the patch from http://drupal.org/node/169132) or adding a 'collect' operation
  • Add an option for adding additional pre_render callback functions to the form. Use case: the gotcha CAPTCHA has to be hidden with CSS.

Comments

robloach’s picture

Add an option for CAPTCHA types to disable the CAPTCHA description.

If you just take out the description string, it won't display the fieldset. This same problem happens for reCAPTCHA as well, where a description isn't really needed. It's usually easiest just to remove the description string. I'm not sure what design we should take with this. Maybe in the API have a #removedescription attribute that, when set to TRUE, will force set the description to an empty string.

Add support for multi widget CAPTCHA types

Replied at http://drupal.org/node/169132 .

Add an option for adding additional pre_render callback functions to the form.

This is something that would be handy.

function gotcha_captcha($op, $captcha_type = '', &$form) {
  case 'pre_render':
    $form['captcha_response']['#weight'] = -10;
    break;
}

You'd have to pass the &$form to the _captcha hook so that it could do something with form.

soxofaan’s picture

Version: 5.x-3.x-dev » 6.x-2.x-dev
wundo’s picture

Status: Active » Fixed

Marking this as fixed ;)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.