You are here

function multichoice_list_questions in Quiz 5

Same name and namespace in other branches
  1. 5.2 multichoice.module \multichoice_list_questions()
  2. 6.6 question_types/multichoice/multichoice.module \multichoice_list_questions()
  3. 6.2 multichoice.module \multichoice_list_questions()
  4. 6.3 question_types/multichoice/multichoice.module \multichoice_list_questions()
  5. 6.5 question_types/multichoice/multichoice.module \multichoice_list_questions()

List all multiple choice questions

Return value

Array of questions

File

./multichoice.module, line 466
Multiple choice question type for quiz module

Code

function multichoice_list_questions() {
  $result = db_query("SELECT nid, body, format FROM {node} WHERE type= '%s'", 'multichoice');
  $questions = array();
  while ($node = db_fetch_object($result)) {
    $question = new stdClass();
    $question->question = check_markup($node->body, $node->format);
    $question->nid = $node->nid;
    $questions[] = $question;
  }
  return $questions;
}