You are here

function _quiz_get_questions_count in Quiz 6.6

1 call to _quiz_get_questions_count()
theme_quiz_dashboard_get_basic_stats in includes/quiz_dashboard/quiz_dashboard.admin.inc

File

includes/quiz_dashboard/quiz_dashboard.admin.inc, line 213

Code

function _quiz_get_questions_count($nid, $uid = 0) {
  $sql = "SELECT COUNT(child_nid) FROM {quiz_node_relationship} WHERE parent_nid = %d";
  if ($uid != 0) {
    $sql .= " AND uid = %d";
  }
  return db_result(db_query($sql, $nid, $uid));
}