You are here

function quiz_question_delete_result in Quiz 7

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.6 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()

Implements hook_delete_result().

Parameters

$rid: Result id

$nid: Question node id

$vid: Question node version id

1 call to quiz_question_delete_result()
quiz_delete_results in ./quiz.module
Delete quiz results.

File

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

Code

function quiz_question_delete_result($rid, $nid, $vid) {
  $response = _quiz_question_response_get_instance($rid, NULL, NULL, $nid, $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');
  }
}