public function TrueFalseResponse::save in Quiz 7.5
Same name and namespace in other branches
- 6.6 question_types/truefalse/truefalse.classes.inc \TrueFalseResponse::save()
- 6.3 question_types/quiz_question/quiz_question.truefalse.inc \TrueFalseResponse::save()
- 6.4 question_types/truefalse/truefalse.classes.inc \TrueFalseResponse::save()
- 6.5 question_types/quiz_question/quiz_question.truefalse.inc \TrueFalseResponse::save()
- 7.6 question_types/truefalse/truefalse.classes.inc \TrueFalseResponse::save()
- 7 question_types/truefalse/truefalse.classes.inc \TrueFalseResponse::save()
- 7.4 question_types/truefalse/truefalse.classes.inc \TrueFalseResponse::save()
Implementation of save().
Overrides QuizQuestionResponse::save
See also
File
- question_types/
truefalse/ truefalse.classes.inc, line 225 - TrueFalse classes.
Class
- TrueFalseResponse
- Extension of QuizQuestionResponse.
Code
public function save() {
db_merge('quiz_truefalse_user_answers')
->key(array(
'result_answer_id' => $this->result_answer_id,
))
->fields(array(
'result_answer_id' => $this->result_answer_id,
'answer' => (int) $this->answer,
'score' => (int) $this
->getScore(),
))
->execute();
}