You are here

public function ClozeResponse::save in Cloze 6

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

Implementation of save

See also

QuizQuestionResponse#save()

File

./cloze.classes.inc, line 265
The main classes for the short answer question type.

Class

ClozeResponse
Extension of QuizQuestionResponse

Code

public function save() {
  $sql = 'INSERT INTO {quiz_cloze_user_answers} (answer, question_nid, question_vid, result_id, score) VALUES ("%s", %d, %d, %d, %d)';
  db_query($sql, serialize($this->answer), $this->question->nid, $this->question->vid, $this->rid, $this
    ->getScore(FALSE));
  $this->answer_id = db_last_insert_id('quiz_cloze_user_answers', 'answer_id');
}