You are here

public function TrueFalseResponse::__construct in Quiz 6.6

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

File

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

Class

TrueFalseResponse

Code

public function __construct($rid, $question, $answer = NULL) {
  $this->rid = $rid;
  $this->question = $question;
  if (!isset($answer)) {
    $r = $this
      ->getCorrectAnswer();
    if (!empty($r)) {
      $this->answer = $r->answer;
      $this->score = $r->score;
    }
  }
  else {
    $this->answer = $answer;
  }
}