You are here

public function ClozeResponse::save in Cloze 7

Same name and namespace in other branches
  1. 6 cloze.classes.inc \ClozeResponse::save()

Implementation of save

See also

QuizQuestionResponse#save()

File

./cloze.classes.inc, line 305
The main classes for the cloze question type. These inherit or implement code found in quiz_question.classes.inc.

Class

ClozeResponse
Extension of QuizQuestionResponse

Code

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