You are here

public function TrueFalseResponse::getUserAnswer in Quiz 7.5

Same name and namespace in other branches
  1. 7.6 question_types/truefalse/truefalse.classes.inc \TrueFalseResponse::getUserAnswer()

Get the user's answer from the database.

Return value

array An array containing both the answer and the score

1 call to TrueFalseResponse::getUserAnswer()
TrueFalseResponse::__construct in question_types/truefalse/truefalse.classes.inc
Constructor.

File

question_types/truefalse/truefalse.classes.inc, line 272
TrueFalse classes.

Class

TrueFalseResponse
Extension of QuizQuestionResponse.

Code

public function getUserAnswer() {
  if (isset($this->result_answer_id)) {
    return db_query('SELECT answer, score FROM {quiz_truefalse_user_answers} WHERE result_answer_id = :raid', array(
      ':raid' => $this->result_answer_id,
    ))
      ->fetch();
  }
}