You are here

function _quiz_delete_users_results in Quiz 7

Same name and namespace in other branches
  1. 8.6 quiz.module \_quiz_delete_users_results()
  2. 8.4 quiz.module \_quiz_delete_users_results()
  3. 8.5 quiz.module \_quiz_delete_users_results()
  4. 6.4 quiz.module \_quiz_delete_users_results()
  5. 7.6 quiz.module \_quiz_delete_users_results()
  6. 7.4 quiz.module \_quiz_delete_users_results()
  7. 7.5 quiz.module \_quiz_delete_users_results()
  8. 6.x quiz.module \_quiz_delete_users_results()

Deletes all results associated with a given user.

Parameters

int $uid: The users id

1 call to _quiz_delete_users_results()
quiz_user_cancel in ./quiz.module
Implements hook_user_cancel().

File

./quiz.module, line 1501
Quiz Module

Code

function _quiz_delete_users_results($uid) {
  $res = db_query("SELECT result_id FROM {quiz_node_results} WHERE uid = :uid", array(
    ':uid' => $uid,
  ));
  $rids = array();
  while ($rid = $res
    ->fetchField()) {
    $rids[] = $rid;
  }
  quiz_delete_results($rids);
}