Index: captcha.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/captcha/captcha.admin.inc,v
retrieving revision 1.32.2.3
diff -u -p -r1.32.2.3 captcha.admin.inc
--- captcha.admin.inc	26 Sep 2010 23:05:46 -0000	1.32.2.3
+++ captcha.admin.inc	12 Nov 2010 19:58:46 -0000
@@ -65,34 +65,42 @@ function captcha_admin_settings(&$form_s
   );
   $form['captcha_form_protection']['captcha_form_id_overview']['captcha_captcha_points'] = array();
   $captcha_type_options = _captcha_available_challenge_types();
-  // TODO: make a wrapper for this query to make it a bit cleaner?
-  $result = db_query("SELECT * FROM {captcha_points} ORDER BY form_id");
-  while ($captcha_point = db_fetch_object($result)) {
-    $form['captcha_form_protection']['captcha_form_id_overview']['captcha_captcha_points'][$captcha_point->form_id] = array();
-    $form['captcha_form_protection']['captcha_form_id_overview']['captcha_captcha_points'][$captcha_point->form_id]['form_id'] = array(
+
+  $captcha_points = captcha_get_captcha_points();
+  foreach ($captcha_points as $captcha_point) {
+    $elem = array();
+    $elem['form_id'] = array(
       '#value' => $captcha_point->form_id,
     );
     // Select widget for CAPTCHA type.
     if (isset($captcha_point->module) && $captcha_point->module) {
-      $captcha_type = $captcha_point->module .'/'. $captcha_point->type;
+      $captcha_type = $captcha_point->module .'/'. $captcha_point->captcha_type;
     }
-    elseif ($captcha_point->type == 'default') {
+    elseif ($captcha_point->captcha_type == 'default') {
       $captcha_type = 'default';
     }
     else {
       $captcha_type = 'none';
     }
-    $form['captcha_form_protection']['captcha_form_id_overview']['captcha_captcha_points'][$captcha_point->form_id]['captcha_type'] = array(
+    $elem['captcha_type'] = array(
       '#type' => 'select',
       '#default_value' => $captcha_type,
       '#options' => $captcha_type_options,
     );
     // Additional operations.
-    $form['captcha_form_protection']['captcha_form_id_overview']['captcha_captcha_points'][$captcha_point->form_id]['operations'] = array(
-      '#value' => implode(", ", array(
-        l(t('delete'), "admin/user/captcha/captcha/captcha_point/{$captcha_point->form_id}/delete"),
-      ))
-    );
+    $ops = array();
+    if (module_exists('ctools') && $captcha_point->export_type & EXPORT_IN_CODE) {
+      if ($captcha_point->export_type & EXPORT_IN_DATABASE) {
+        $ops[] = l(t('revert'), "admin/user/captcha/captcha/captcha_point/{$captcha_point->form_id}/delete");
+      }
+      // TODO Disable exported points.
+    }
+    else {
+      $ops[] = l(t('delete'), "admin/user/captcha/captcha/captcha_point/{$captcha_point->form_id}/delete");
+    }
+    $elem['operations'] = array('#value' => implode(", ", $ops));
+
+    $form['captcha_form_protection']['captcha_form_id_overview']['captcha_captcha_points'][$captcha_point->form_id] = $elem;
   }
 
   // Form items for new form_id.
@@ -275,7 +283,30 @@ function captcha_admin_settings_submit($
 
   // Process CAPTCHA points
   if (isset($form_state['values']['captcha_form_id_overview']['captcha_captcha_points'])) {
+    // Load existing data.
+    $captcha_points = captcha_get_captcha_points();
+     
+
     foreach ($form_state['values']['captcha_form_id_overview']['captcha_captcha_points'] as $captcha_point_form_id => $data) {
+
+      // If this is an in-code captcha point and its settings are unchanged,
+      // don't save to the database.
+      if (module_exists('ctools') && isset($captcha_points[$captcha_point_form_id])) {
+        // Parse module and captcha_type from submitted values.
+        if (is_string($data['captcha_type']) && substr_count($data['captcha_type'], '/') == 1) {
+          list($module, $captcha_type) = explode('/', $data['captcha_type']);
+        }
+        else {
+          $module = '';
+          $captcha_type = $data['captcha_type'];
+        }
+
+        $point = $captcha_points[$captcha_point_form_id];
+        if ($point->export_type & EXPORT_IN_CODE && !($point->export_type & EXPORT_IN_DATABASE) && $point->module == $module && $point->captcha_type == $captcha_type) {
+          continue;
+        }
+      }
+
       captcha_set_form_id_setting($captcha_point_form_id, $data['captcha_type']);
     }
   }
@@ -358,7 +389,7 @@ function captcha_point_admin_form($form_
     );
     $captcha_point = captcha_get_form_id_setting($captcha_point_form_id);
     if ($captcha_point) {
-      $default_captcha_type = "{$captcha_point->module}/{$captcha_point->type}";
+      $default_captcha_type = "{$captcha_point->module}/{$captcha_point->captcha_type}";
     }
   }
   else {
Index: captcha.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/captcha/captcha.inc,v
retrieving revision 1.11.2.5
diff -u -p -r1.11.2.5 captcha.inc
--- captcha.inc	26 Sep 2010 23:05:46 -0000	1.11.2.5
+++ captcha.inc	12 Nov 2010 19:58:46 -0000
@@ -15,29 +15,29 @@
  *   - 'default' to use the default challenge type
  *   - NULL to remove the entry for the CAPTCHA type
  *   - something of the form 'image_captcha/Image'
- *   - an object with attributes $captcha_type->module and $captcha_type->type
+ *   - an object with attributes $captcha_type->module and $captcha_type->captcha_type
  * @return nothing
  */
 function captcha_set_form_id_setting($form_id, $captcha_type) {
   if ($captcha_type == 'none') {
     db_query("DELETE FROM {captcha_points} WHERE form_id = '%s'", $form_id);
-    db_query("INSERT INTO {captcha_points} (form_id, module, type) VALUES ('%s', NULL, NULL)", $form_id);
+    db_query("INSERT INTO {captcha_points} (form_id, module, captcha_type) VALUES ('%s', NULL, NULL)", $form_id);
   }
   elseif ($captcha_type == 'default') {
     db_query("DELETE FROM {captcha_points} WHERE form_id = '%s'", $form_id);
-    db_query("INSERT INTO {captcha_points} (form_id, module, type) VALUES ('%s', NULL, '%s')", $form_id, 'default');
+    db_query("INSERT INTO {captcha_points} (form_id, module, captcha_type) VALUES ('%s', NULL, '%s')", $form_id, 'default');
   }
   elseif ($captcha_type == NULL) {
     db_query("DELETE FROM {captcha_points} WHERE form_id = '%s'", $form_id);
   }
-  elseif (is_object($captcha_type) && isset($captcha_type->module) && isset($captcha_type->type)) {
+  elseif (is_object($captcha_type) && isset($captcha_type->module) && isset($captcha_type->captcha_type)) {
     db_query("DELETE FROM {captcha_points} WHERE form_id = '%s'", $form_id);
-    db_query("INSERT INTO {captcha_points} (form_id, module, type) VALUES ('%s', '%s', '%s')", $form_id, $captcha_type->module, $captcha_type->type);
+    db_query("INSERT INTO {captcha_points} (form_id, module, captcha_type) VALUES ('%s', '%s', '%s')", $form_id, $captcha_type->module, $captcha_type->captcha_type);
   }
   elseif (is_string($captcha_type) && substr_count($captcha_type, '/') == 1) {
     list($module, $type) = explode('/', $captcha_type);
     db_query("DELETE FROM {captcha_points} WHERE form_id = '%s'", $form_id);
-    db_query("INSERT INTO {captcha_points} (form_id, module, type) VALUES ('%s', '%s', '%s')", $form_id, $module, $type);
+    db_query("INSERT INTO {captcha_points} (form_id, module, captcha_type) VALUES ('%s', '%s', '%s')", $form_id, $module, $type);
   }
   else {
     drupal_set_message(t('Failed to set a CAPTCHA type for form %form_id: could not interpret value "@captcha_type"',
@@ -52,39 +52,64 @@ function captcha_set_form_id_setting($fo
  * @param $symbolic flag to return as (symbolic) strings instead of object.
  *
  * @return NULL if no setting is known
- *   or a captcha_point object with fields 'module' and 'type'.
+ *   or a captcha_point object with fields 'module' and 'captcha_type'.
  *   If argument $symbolic is true, returns (symbolic) as 'none', 'default'
  *   or in the form 'captcha/Math'.
  */
 function captcha_get_form_id_setting($form_id, $symbolic=FALSE) {
-  $result = db_query("SELECT module, type FROM {captcha_points} WHERE form_id = '%s'", $form_id);
-  if (!$result) {
-    return NULL;
+  if (module_exists('ctools')) {
+    ctools_include('export');
+    $captcha_point = array_pop(ctools_export_load_object('captcha_points', 'names', array($form_id)));
   }
-  $captcha_point = db_fetch_object($result);
+  else {
+    $result = db_query("SELECT module, captcha_type FROM {captcha_points} WHERE form_id = '%s'", $form_id);
+    if (!$result) {
+      return NULL;
+    }
+    $captcha_point = db_fetch_object($result);
+  }
+
   if (!$captcha_point) {
     $captcha_point = NULL;
   }
-  elseif ($captcha_point->type == 'default') {
+  elseif ($captcha_point->captcha_type == 'default') {
     if (!$symbolic) {
       list($module, $type) = explode('/', variable_get('captcha_default_challenge', 'captcha/Math'));
       $captcha_point->module = $module;
-      $captcha_point->type = $type;
+      $captcha_point->captcha_type = $type;
     }
     else {
       $captcha_point = 'default';
     }
   }
-  elseif ($captcha_point->module == NULL && $captcha_point->type == NULL && $symbolic) {
+  elseif ($captcha_point->module == NULL && $captcha_point->captcha_type == NULL && $symbolic) {
     $captcha_point = 'none';
   }
   elseif ($symbolic) {
-    $captcha_point = $captcha_point->module .'/'. $captcha_point->type;
+    $captcha_point = $captcha_point->module .'/'. $captcha_point->captcha_type;
   }
   return $captcha_point;
 }
 
-
+/**
+ * Helper function to load all captcha points.
+ *
+ * @return array of all captcha_points
+ */
+function captcha_get_captcha_points() {
+  if (module_exists('ctools')) {
+    ctools_include('export');
+    $captcha_points = ctools_export_load_object('captcha_points', 'all');
+  }
+  else {
+    $captcha_points = array();
+    $result = db_query("SELECT * FROM {captcha_points} ORDER BY form_id");
+    while ($captcha_point = db_fetch_object($result)) {
+      $captcha_points[] = $captcha_point;
+    }
+  }
+  return $captcha_points;
+}
 /**
  * Helper function for generating a new CAPTCHA session.
  *
Index: captcha.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/captcha/captcha.install,v
retrieving revision 1.11.2.5
diff -u -p -r1.11.2.5 captcha.install
--- captcha.install	1 Nov 2010 20:54:50 -0000	1.11.2.5
+++ captcha.install	12 Nov 2010 19:58:46 -0000
@@ -13,6 +13,18 @@ function captcha_schema() {
   // Table for positions and types of the challenges.
   $schema['captcha_points'] = array(
     'description' => 'This table describes which challenges should be added to which forms.',
+    'export' => array(
+      'key' => 'form_id',
+      'identifier' => 'captcha',
+      'default hook' => 'captcha_default_points',  // Function hook name.
+      'status' => 'mark_status',
+      'api' => array(
+        'owner' => 'captcha',
+        'api' => 'captcha',  // Base name for api include files.
+        'minimum_version' => 1,
+        'current_version' => 1,
+      ),
+    ),
     'fields' => array(
       'form_id' => array(
         'description' => 'The form_id of the form to add a CAPTCHA to.',
@@ -25,7 +37,7 @@ function captcha_schema() {
         'type' => 'varchar',
         'length' => 64,
       ),
-      'type' => array(
+      'captcha_type' => array(
         'description' => 'The challenge type to use.',
         'type' => 'varchar',
         'length' => 64,
@@ -136,17 +148,6 @@ function captcha_install() {
   $t = get_t();
   drupal_install_schema('captcha');
 
-  // insert some defaults
-  $form_ids = array(
-    'comment_form',
-    'contact_mail_user', 'contact_mail_page',
-    'user_register', 'user_pass', 'user_login', 'user_login_block',
-    'forum_node_form'
-  );
-  foreach ($form_ids as $form_id) {
-    db_query("INSERT INTO {captcha_points} (form_id, module, type) VALUES ('%s', NULL, NULL)", $form_id);
-  }
-
   // what to do after install?
   drupal_set_message($t('You can now <a href="!captcha_admin">configure the CAPTCHA module</a> for your site.',
     array('!captcha_admin' => url('admin/user/captcha'))), 'status');
@@ -323,3 +324,12 @@ function captcha_update_6202() {
   return $ret;
 }
 
+/**
+ * Implementation of hook_update_N()
+ * Rename the type field to captcha_type in captcha_points.
+ */
+function captcha_update_6203() {
+  $ret = array();
+  db_change_field($ret, 'captcha_points', 'type', 'captcha_type', array('type' => 'varchar', 'length' => 64));
+  return $ret;
+}
Index: captcha.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/captcha/captcha.module,v
retrieving revision 1.103.2.12
diff -u -p -r1.103.2.12 captcha.module
--- captcha.module	31 Oct 2010 10:01:50 -0000	1.103.2.12
+++ captcha.module	12 Nov 2010 19:58:47 -0000
@@ -228,7 +228,7 @@ function captcha_process($element, $edit
     'form_id' => $posted_form_id,
     'captcha_sid' => $captcha_sid,
     'module' => $captcha_type_module,
-    'type' => $captcha_type_challenge,
+    'captcha_type' => $captcha_type_challenge,
   );
   $element['#captcha_info'] = array(
     'form_id' => $this_form_id,
@@ -273,6 +273,49 @@ function captcha_process($element, $edit
   return $element;
 }
 
+/**
+ * Implementation of hook_captcha_default_points_alter().
+ *
+ * Provide some default captchas only if defaults are not already
+ * provided by other modules.
+ */
+function captcha_captcha_default_points_alter(&$items)  {
+  $modules = array(
+    'comment' => array(
+      'comment_form',
+    ),
+    'contact' => array(
+      'contact_mail_user',
+      'contact_mail_page',
+    ),
+    'forum' => array(
+      'forum_node_form',
+    ),
+    'user' => array(
+      'user_register',
+      'user_pass',
+      'user_login',
+      'user_login_block',
+    ),
+  );
+  foreach ($modules as $module => $form_ids) {
+    // Only give defaults if the module exists.
+    if (module_exists($module)) {
+      foreach ($form_ids as $form_id) {
+        // Ensure a default has not been provided already.
+        if (!isset($items[$form_id])) {
+          $captcha = new stdClass;
+          $captcha->disabled = FALSE;
+          $captcha->api_version = 1;
+          $captcha->form_id = $form_id;
+          $captcha->module = '';
+          $captcha->captcha_type = 'default';
+          $items[$form_id] = $captcha;
+        }
+      }
+    }
+  }
+}
 
 /**
  * Theme function for a CAPTCHA element.
@@ -314,12 +357,12 @@ function captcha_form_alter(&$form, $for
 
       // Get CAPTCHA type and module for given form_id.
       $captcha_point = captcha_get_form_id_setting($form_id);
-      if ($captcha_point && $captcha_point->type) {
+      if ($captcha_point && $captcha_point->captcha_type) {
         module_load_include('inc', 'captcha');
         // Build CAPTCHA form element.
         $captcha_element = array(
           '#type' => 'captcha',
-          '#captcha_type' => $captcha_point->module .'/'. $captcha_point->type,
+          '#captcha_type' => $captcha_point->module .'/'. $captcha_point->captcha_type,
         );
         // Add a CAPTCHA description if required.
         if (variable_get('captcha_add_captcha_description', TRUE)) {
@@ -341,8 +384,8 @@ function captcha_form_alter(&$form, $for
         '#collapsible' => TRUE,
         '#collapsed' => TRUE,
       );
-      if ($captcha_point !== NULL && $captcha_point->type) {
-        $captcha_element['#title'] = t('CAPTCHA: challenge "@type" enabled', array('@type' => $captcha_point->type));
+      if ($captcha_point !== NULL && $captcha_point->captcha_type) {
+        $captcha_element['#title'] = t('CAPTCHA: challenge "@type" enabled', array('@type' => $captcha_point->captcha_type));
         $captcha_element['#description'] = t('Untrusted users will see a CAPTCHA here (!settings).',
           array('!settings' => l(t('general CAPTCHA settings'), 'admin/user/captcha'))
         );
@@ -350,7 +393,7 @@ function captcha_form_alter(&$form, $for
           '#type' => 'item',
           '#title' => t('Enabled challenge'),
           '#value' => t('"@type" by module "@module" (!change, !disable)', array(
-            '@type' => $captcha_point->type,
+            '@type' => $captcha_point->captcha_type,
             '@module' => $captcha_point->module,
             '!change' => l(t('change'), "admin/user/captcha/captcha/captcha_point/$form_id", array('query' => drupal_get_destination())),
             '!disable' => l(t('disable'), "admin/user/captcha/captcha/captcha_point/$form_id/disable", array('query' => drupal_get_destination())),
@@ -372,7 +415,7 @@ function captcha_form_alter(&$form, $for
           );
           $captcha_element['example']['example_captcha'] = array(
             '#type' => 'captcha',
-            '#captcha_type' => $captcha_point->module .'/'. $captcha_point->type,
+            '#captcha_type' => $captcha_point->module .'/'. $captcha_point->captcha_type,
             '#captcha_admin_mode' => TRUE,
           );
         }
@@ -580,7 +623,7 @@ function captcha_validate($element, &$fo
           '%form_id post blocked by CAPTCHA module: challenge "%challenge" (by module "%module"), user answered "%response", but the solution was "%solution".',
           array('%form_id' => $form_id,
             '%response' => $captcha_response, '%solution' => $solution,
-            '%challenge' => $captcha_info['type'], '%module' => $captcha_info['module'],
+            '%challenge' => $captcha_info['captcha_type'], '%module' => $captcha_info['module'],
           ),
           WATCHDOG_NOTICE
         );
Index: captcha.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/captcha/captcha.test,v
retrieving revision 1.14.2.5
diff -u -p -r1.14.2.5 captcha.test
--- captcha.test	26 Sep 2010 23:05:46 -0000	1.14.2.5
+++ captcha.test	12 Nov 2010 19:58:47 -0000
@@ -346,7 +346,7 @@ class CaptchaAdminTestCase extends Captc
     $result = captcha_get_form_id_setting('comment_form');
     $this->assertNotNull($result, 'Setting and getting CAPTCHA point: none', 'CAPTCHA');
     $this->assertNull($result->module, 'Setting and getting CAPTCHA point: none', 'CAPTCHA');
-    $this->assertNull($result->type, 'Setting and getting CAPTCHA point: none', 'CAPTCHA');
+    $this->assertNull($result->captcha_type, 'Setting and getting CAPTCHA point: none', 'CAPTCHA');
     $result = captcha_get_form_id_setting('comment_form', TRUE);
     $this->assertEqual($result, 'none', 'Setting and symbolic getting CAPTCHA point: "none"', 'CAPTCHA');
     // Set to 'default'
@@ -355,7 +355,7 @@ class CaptchaAdminTestCase extends Captc
     $result = captcha_get_form_id_setting('comment_form');
     $this->assertNotNull($result, 'Setting and getting CAPTCHA point: default', 'CAPTCHA');
     $this->assertEqual($result->module, 'foo', 'Setting and getting CAPTCHA point: default', 'CAPTCHA');
-    $this->assertEqual($result->type, 'bar', 'Setting and getting CAPTCHA point: default', 'CAPTCHA');
+    $this->assertEqual($result->captcha_type, 'bar', 'Setting and getting CAPTCHA point: default', 'CAPTCHA');
     $result = captcha_get_form_id_setting('comment_form', TRUE);
     $this->assertEqual($result, 'default', 'Setting and symbolic getting CAPTCHA point: "default"', 'CAPTCHA');
     // Set to 'baz/boo'.
@@ -363,7 +363,7 @@ class CaptchaAdminTestCase extends Captc
     $result = captcha_get_form_id_setting('comment_form');
     $this->assertNotNull($result, 'Setting and getting CAPTCHA point: baz/boo', 'CAPTCHA');
     $this->assertEqual($result->module, 'baz', 'Setting and getting CAPTCHA point: baz/boo', 'CAPTCHA');
-    $this->assertEqual($result->type, 'boo', 'Setting and getting CAPTCHA point: baz/boo', 'CAPTCHA');
+    $this->assertEqual($result->captcha_type, 'boo', 'Setting and getting CAPTCHA point: baz/boo', 'CAPTCHA');
     $result = captcha_get_form_id_setting('comment_form', TRUE);
     $this->assertEqual($result, 'baz/boo', 'Setting and symbolic getting CAPTCHA point: "baz/boo"', 'CAPTCHA');
     // Set to NULL (which should delete the CAPTCHA point setting entry).
@@ -375,12 +375,12 @@ class CaptchaAdminTestCase extends Captc
     // Set with object.
     $captcha_type = new stdClass;
     $captcha_type->module = 'baba';
-    $captcha_type->type = 'fofo';
+    $captcha_type->captcha_type = 'fofo';
     captcha_set_form_id_setting('comment_form', $captcha_type);
     $result = captcha_get_form_id_setting('comment_form');
     $this->assertNotNull($result, 'Setting and getting CAPTCHA point: baba/fofo', 'CAPTCHA');
     $this->assertEqual($result->module, 'baba', 'Setting and getting CAPTCHA point: baba/fofo', 'CAPTCHA');
-    $this->assertEqual($result->type, 'fofo', 'Setting and getting CAPTCHA point: baba/fofo', 'CAPTCHA');
+    $this->assertEqual($result->captcha_type, 'fofo', 'Setting and getting CAPTCHA point: baba/fofo', 'CAPTCHA');
     $result = captcha_get_form_id_setting('comment_form', TRUE);
     $this->assertEqual($result, 'baba/fofo', 'Setting and symbolic getting CAPTCHA point: "baba/fofo"', 'CAPTCHA');
 
Index: tests/captcha.admin.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/captcha/tests/captcha.admin.test,v
retrieving revision 1.2
diff -u -p -r1.2 captcha.admin.test
--- tests/captcha.admin.test	4 Jun 2008 08:24:38 -0000	1.2
+++ tests/captcha.admin.test	12 Nov 2010 19:58:47 -0000
@@ -88,7 +88,7 @@ class CaptchaAdminTest extends DrupalTes
     $result = db_fetch_object(db_query("SELECT * FROM {captcha_points} WHERE form_id='%s'", array($captcha_point_form_id)));
     $this->assertEqual($result->module, $captcha_point_module,
       'Enabled CAPTCHA point should have module set');
-    $this->assertEqual($result->type, $captcha_point_type,
+    $this->assertEqual($result->captcha_type, $captcha_point_type,
       'Enabled CAPTCHA point should have type set');
 
     // Disable CAPTCHA point again
@@ -99,7 +99,7 @@ class CaptchaAdminTest extends DrupalTes
     $result = db_fetch_object(db_query("SELECT * FROM {captcha_points} WHERE form_id='%s'", array($captcha_point_form_id)));
     $this->assertNull($result->module,
       'Disabled CAPTCHA point should have NULL as module');
-    $this->assertNull($result->type,
+    $this->assertNull($result->captcha_type,
       'Disabled CAPTCHA point should have NULL as type');
 
     // Set CAPTCHA point through admin/user/captcha/captcha/captcha_point/$form_id
@@ -114,7 +114,7 @@ class CaptchaAdminTest extends DrupalTes
     $result = db_fetch_object(db_query("SELECT * FROM {captcha_points} WHERE form_id='%s'", array($captcha_point_form_id)));
     $this->assertEqual($result->module, $captcha_point_module,
       'Enabled CAPTCHA point should have module set');
-    $this->assertEqual($result->type, $captcha_point_type,
+    $this->assertEqual($result->captcha_type, $captcha_point_type,
       'Enabled CAPTCHA point should have type set');
 
     // Delete CAPTCHA point
@@ -175,7 +175,7 @@ class CaptchaAdminTest extends DrupalTes
     $result = db_fetch_object(db_query("SELECT * FROM {captcha_points} WHERE form_id='%s'", array($captcha_point_form_id)));
     $this->assertEqual($result->module, $captcha_point_module,
       'Enabled CAPTCHA point should still have module set');
-    $this->assertEqual($result->type, $captcha_point_type,
+    $this->assertEqual($result->captcha_type, $captcha_point_type,
       'Enabled CAPTCHA point should still have type set');
 
     // Delete CAPTCHA point
