You are here

public function TrueFalseResponse::getResponse in Quiz 7

Same name and namespace in other branches
  1. 6.6 question_types/truefalse/truefalse.classes.inc \TrueFalseResponse::getResponse()
  2. 6.3 question_types/quiz_question/quiz_question.truefalse.inc \TrueFalseResponse::getResponse()
  3. 6.4 question_types/truefalse/truefalse.classes.inc \TrueFalseResponse::getResponse()
  4. 6.5 question_types/quiz_question/quiz_question.truefalse.inc \TrueFalseResponse::getResponse()
  5. 7.6 question_types/truefalse/truefalse.classes.inc \TrueFalseResponse::getResponse()
  6. 7.4 question_types/truefalse/truefalse.classes.inc \TrueFalseResponse::getResponse()
  7. 7.5 question_types/truefalse/truefalse.classes.inc \TrueFalseResponse::getResponse()

Implementation of getResponse

Overrides QuizQuestionResponse::getResponse

See also

QuizQuestionResponse#getResponse()

1 call to TrueFalseResponse::getResponse()
TrueFalseResponse::score in question_types/truefalse/truefalse.classes.inc
Implementation of score

File

question_types/truefalse/truefalse.classes.inc, line 289
Defines the classes necessary for a True/False quiz.

Class

TrueFalseResponse
Extension of QuizQuestionResponse

Code

public function getResponse() {
  if (!isset($this->answer)) {
    $correct_answer = $this
      ->getCorrectAnswer();
    $this->answer = isset($correct_answer->answer) ? $correct_answer->answer : '';
  }
  return $this->answer;
}