You are here

function _quiz_get_answers in Quiz 5

Same name and namespace in other branches
  1. 8.4 quiz.module \_quiz_get_answers()
  2. 5.2 quiz.module \_quiz_get_answers()
  3. 6.6 quiz.module \_quiz_get_answers()
  4. 6.2 quiz.module \_quiz_get_answers()
  5. 6.3 quiz.module \_quiz_get_answers()
  6. 6.4 quiz.module \_quiz_get_answers()
  7. 6.5 quiz.module \_quiz_get_answers()
  8. 7.6 quiz.module \_quiz_get_answers()
  9. 7 quiz.module \_quiz_get_answers()
  10. 7.4 quiz.module \_quiz_get_answers()
  11. 7.5 quiz.module \_quiz_get_answers()
3 calls to _quiz_get_answers()
quiz_admin_results in ./quiz.module
quiz_take_quiz in ./quiz.module
Handles quiz taking
quiz_user_results in ./quiz.module

File

./quiz.module, line 1450
Quiz Module

Code

function _quiz_get_answers($rid) {
  $results = array();
  $dbresult = db_query("SELECT\n                          qqr.question_nid qnid,\n                          qqr.answer qanswer,\n                          nr.body question,\n                          n.type type\n                        FROM {quiz_question_results} qqr, {quiz_question} qq, {node} n, {node_revisions} nr\n                        WHERE\n                          qqr.result_rid = %d\n                            AND\n                          qqr.question_nid = qq.nid\n                            AND\n                          n.nid = qq.nid\n                            AND\n                          nr.nid = n.nid", $rid);

  //Create results array
  while ($line = db_fetch_array($dbresult)) {
    $results[$line['qnid']] = $line;
  }
  return $results;
}