You are here

function opigno_in_house_training_app_int_finished in Opigno in house training app 7

2 calls to opigno_in_house_training_app_int_finished()
opigno_in_house_training_score_form_submit in ./opigno_in_house_training_app.module
opigno_in_house_training_score_form_submit_1 in ./opigno_in_house_training_app.module

File

./opigno_in_house_training_app.module, line 312

Code

function opigno_in_house_training_app_int_finished($ihtid, $score, $status, $taker = NULL) {
  if (module_exists('rules')) {
    $taker = user_load($taker);
    $iht = node_load($ihtid);
    $author = user_load($iht->uid);
    if ((int) $status == 1) {
      $hook_name = 'opigno_in_house_training_finished';
      foreach (module_implements($hook_name) as $module) {
        $function = $module . '_' . $hook_name;
        $function($taker, $iht, $score);
      }
      foreach ($iht->og_group_ref[LANGUAGE_NONE] as $index => $value) {
        if (opigno_quiz_app_user_passed($value['target_id'], $taker->uid)) {
          rules_invoke_event('opigno_quiz_app_rules_quiz_passed', $taker, $author, $iht);
          drupal_get_messages();
        }
      }
    }
  }
}