You are here

function quiz_get_quiz_options in Quiz 7

Same name and namespace in other branches
  1. 6.4 quiz.module \quiz_get_quiz_options()
  2. 7.6 quiz.module \quiz_get_quiz_options()
  3. 7.4 quiz.module \quiz_get_quiz_options()

Returns an array with quiz titles keyed with quiz node ids.

Return value

array Options suitable for a form, in which the value is nid.

File

./quiz.module, line 3734
Quiz Module

Code

function quiz_get_quiz_options() {
  $options = array();
  $results = db_query('SELECT n.nid, n.title, n.type FROM {node} n WHERE n.type = :type', array(
    ':type' => 'quiz',
  ));
  foreach ($results as $result) {
    $options[$result->nid] = drupal_substr(check_plain($result->title), 0, 30);
  }
  return $options;
}