You are here

function _quiz_get_terms in Quiz 7

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

Get data for all terms belonging to a Quiz with categorized random questions

Parameters

int $vid: version id for the quiz

Return value

array Array with all terms that belongs to the quiz as objects

Related topics

2 calls to _quiz_get_terms()
_quiz_build_categorized_question_list in ./quiz.module
Builds the questionlist for quizzes with categorized random questions
_quiz_categorized_existing_terms_form in ./quiz.admin.inc

File

./quiz.module, line 2890
Quiz Module

Code

function _quiz_get_terms($vid) {
  $sql = 'SELECT td.name, qt.*
    FROM {quiz_terms} qt
    JOIN {taxonomy_term_data} td ON qt.tid = td.tid
    WHERE qt.vid = :qt.vid
    ORDER BY qt.weight';
  return db_query($sql, array(
    ':qt.vid' => $vid,
  ))
    ->fetchAssoc();
}