You are here

function quiz_question_delete_result in Quiz 7.6

Same name and namespace in other branches
  1. 8.4 question_types/quiz_question/quiz_question.module \quiz_question_delete_result()
  2. 6.4 question_types/quiz_question/quiz_question.module \quiz_question_delete_result()
  3. 7 question_types/quiz_question/quiz_question.module \quiz_question_delete_result()
  4. 7.4 question_types/quiz_question/quiz_question.module \quiz_question_delete_result()

Delete a question response by result and question.

Parameters

int $result_id: Result ID

int $question_nid: Question node ID

int $question_vid: Question version ID

1 call to quiz_question_delete_result()
QuizResultController::delete in includes/QuizResultController.class.inc
Implements EntityAPIControllerInterface.

File

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

Code

function quiz_question_delete_result($result_id, $question_nid, $question_vid) {
  $response = _quiz_question_response_get_instance($result_id, NULL, NULL, $question_nid, $question_vid);
  if ($response) {
    $response
      ->delete();
  }
  else {
    drupal_set_message(t('Unable to delete result. A constructor could not be found for the question-type'), 'error');
  }
}