You are here

function quiz_result_answer_load in Quiz 7.5

Same name and namespace in other branches
  1. 7.6 quiz.module \quiz_result_answer_load()

Load a specific result answer.

5 calls to quiz_result_answer_load()
quiz_end_scoring in ./quiz.module
Score a completed quiz.
quiz_question_answering_form in question_types/quiz_question/quiz_question.module
Get the form to show to the quiz taker.
quiz_question_answering_form_submit_blank in question_types/quiz_question/quiz_question.module
Submit action for "leave blank".
quiz_question_feedback_access in ./quiz.module
Menu access check for question feedback.
quiz_result_is_question_answered in ./quiz.module
Check if the question has already been answered in the requested attempt.

File

./quiz.module, line 3687
quiz.module Main file for the Quiz module.

Code

function quiz_result_answer_load($result_id, $nid, $vid) {
  $sql = 'SELECT * from {quiz_node_results_answers} WHERE result_id = :result_id AND question_nid = :nid AND question_vid = :vid';
  $result = db_query($sql, array(
    ':result_id' => $result_id,
    ':nid' => $nid,
    ':vid' => $vid,
  ));
  if ($row = $result
    ->fetch()) {
    return entity_load_single('quiz_result_answer', $row->result_answer_id);
  }
}