You are here

function quiz_cron in Quiz 7

Same name and namespace in other branches
  1. 8.6 quiz.module \quiz_cron()
  2. 8.4 quiz.module \quiz_cron()
  3. 8.5 quiz.module \quiz_cron()
  4. 6.6 quiz.module \quiz_cron()
  5. 6.3 quiz.module \quiz_cron()
  6. 6.4 quiz.module \quiz_cron()
  7. 6.5 quiz.module \quiz_cron()
  8. 7.6 quiz.module \quiz_cron()
  9. 7.4 quiz.module \quiz_cron()
  10. 7.5 quiz.module \quiz_cron()
  11. 6.x quiz.module \quiz_cron()

@todo Please document this function.

See also

http://drupal.org/node/1354

File

./quiz.module, line 291
Quiz Module

Code

function quiz_cron() {

  // Remove old quiz results that haven't been finished.
  $rm_time = variable_get('quiz_remove_partial_quiz_record', '0');
  if ($rm_time) {

    // $time = 0 for never.
    db_delete('quiz_node_results')
      ->condition('time_end', 0)
      ->where('(:request_time - time_start) > :remove_time', array(
      ':request_time' => REQUEST_TIME,
      ':remove_time' => $rm_time,
    ))
      ->execute();
  }
}