You are here

function riddler_get_riddles in Captcha Riddler 7

Load riddles from the db.

2 calls to riddler_get_riddles()
riddler_captcha in ./riddler.module
Implementation of hook_captcha().
riddler_settings in ./riddler.module
Settings form definition.

File

./riddler.module, line 270
Adds a question and answer type to the Captcha module.

Code

function riddler_get_riddles() {
  $query = db_select('riddler_questions', 'r');
  $query
    ->fields('r', array(
    'question',
    'answer',
  ));
  $result = $query
    ->execute();
  while ($riddle = $result
    ->fetchAssoc()) {
    $riddles[] = $riddle;
  }
  return !empty($riddles) ? $riddles : array();
}