You are here

function opigno_quiz_get_continue_group in Opigno Quiz App 7

File

./opigno_quiz_app.module, line 2069
Module file. Defines module hooks.

Code

function opigno_quiz_get_continue_group($node) {
  global $user;
  if ($node->type == "class") {
    $courses = opigno_class_app_get_class_courses($node);
    foreach ($courses as $course) {
      $course = node_load($course);
      $quiz_to_continue = opigno_quiz_get_continue_course($course, $user->uid);
      if (!empty($quiz_to_continue)) {
        return $quiz_to_continue;
      }
    }
  }
  elseif ($node->type == "course") {
    return opigno_quiz_get_continue_course($node, $user->uid);
  }
  return null;
}