You are here

public function TrueFalseResponse::save in Quiz 7.6

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

Implementation of save

Overrides QuizQuestionResponse::save

See also

QuizQuestionResponse#save()

File

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

Class

TrueFalseResponse
Extension of QuizQuestionResponse

Code

public function save() {
  db_insert('quiz_truefalse_user_answers')
    ->fields(array(
    'question_nid' => $this->question->nid,
    'question_vid' => $this->question->vid,
    'result_id' => $this->result_id,
    'answer' => (int) $this->answer,
    'score' => (int) $this
      ->getScore(),
  ))
    ->execute();
}