You are here

function quiz_question_skip_question in Quiz 7

Same name and namespace in other branches
  1. 8.4 question_types/quiz_question/quiz_question.module \quiz_question_skip_question()
  2. 6.6 question_types/quiz_question/quiz_question.module \quiz_question_skip_question()
  3. 6.3 question_types/quiz_question/quiz_question.module \quiz_question_skip_question()
  4. 6.4 question_types/quiz_question/quiz_question.module \quiz_question_skip_question()
  5. 6.5 question_types/quiz_question/quiz_question.module \quiz_question_skip_question()
  6. 7.4 question_types/quiz_question/quiz_question.module \quiz_question_skip_question()

Implements hook_skip_question().

File

question_types/quiz_question/quiz_question.module, line 247
Quiz Question module. This module provides the basic facilities for adding quiz question types to a quiz.

Code

function quiz_question_skip_question($question, $result_id) {
  unset($_POST['tries']);

  // Unset any answer that might have been set.
  // Delete any old answers for this question (for backwards nav).
  _quiz_question_response_get_instance($result_id, $question)
    ->delete();

  // This is the standard response:
  $response = new stdClass();
  $response->nid = $question->nid;
  $response->vid = $question->vid;
  $response->rid = $result_id;
  $response->is_skipped = TRUE;
  return $response;
}