function _quiz_delete_users_results in Quiz 7
Same name and namespace in other branches
- 8.6 quiz.module \_quiz_delete_users_results()
- 8.4 quiz.module \_quiz_delete_users_results()
- 8.5 quiz.module \_quiz_delete_users_results()
- 6.4 quiz.module \_quiz_delete_users_results()
- 7.6 quiz.module \_quiz_delete_users_results()
- 7.4 quiz.module \_quiz_delete_users_results()
- 7.5 quiz.module \_quiz_delete_users_results()
- 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);
}