public function TrueFalseResponse::__construct in Quiz 6.6
Same name and namespace in other branches
- 6.3 question_types/quiz_question/quiz_question.truefalse.inc \TrueFalseResponse::__construct()
- 6.4 question_types/truefalse/truefalse.classes.inc \TrueFalseResponse::__construct()
- 6.5 question_types/quiz_question/quiz_question.truefalse.inc \TrueFalseResponse::__construct()
- 7.6 question_types/truefalse/truefalse.classes.inc \TrueFalseResponse::__construct()
- 7 question_types/truefalse/truefalse.classes.inc \TrueFalseResponse::__construct()
- 7.4 question_types/truefalse/truefalse.classes.inc \TrueFalseResponse::__construct()
- 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
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;
}
}