You are here

function og_quiz_registry_files_alter in OG Quiz 7

Implements hook_registry_files_alter().

File

./og_quiz.module, line 75
Module hooks and custom logic.

Code

function og_quiz_registry_files_alter(&$files, $modules) {
  $to_delete = array();
  if (module_exists('quiz_question')) {

    // Replace the QuizQuestion class with our own.
    $path = drupal_get_path('module', 'quiz_question');
    unset($files["{$path}/quiz_question.core.inc"]);
    $to_delete[] = drupal_get_path('module', 'og_quiz') . '/includes/og_quiz_question.php';
  }
  if (module_exists('long_answer')) {

    // Replace the LongAnswerResponse class with our own.
    $path = drupal_get_path('module', 'long_answer');
    unset($files["{$path}/long_answer.classes.inc"]);
    $to_delete[] = drupal_get_path('module', 'og_quiz') . '/includes/og_long_answer.php';
  }
  if (!empty($to_delete)) {

    // Force delete of the cached entry, so the registry can be rebuilt corectly.
    db_delete('registry_file')
      ->condition('filename', $to_delete, 'IN')
      ->execute();
  }
}