You are here

function quiz_stats_get_adv_stats in Quiz 6.x

Same name and namespace in other branches
  1. 8.6 modules/quiz_stats/quiz_stats.admin.inc \quiz_stats_get_adv_stats()
  2. 8.4 modules/quiz_stats/quiz_stats.admin.inc \quiz_stats_get_adv_stats()
  3. 8.5 modules/quiz_stats/quiz_stats.admin.inc \quiz_stats_get_adv_stats()
  4. 6.4 includes/quiz_stats/quiz_stats.admin.inc \quiz_stats_get_adv_stats()
  5. 7.6 modules/quiz_stats/quiz_stats.admin.inc \quiz_stats_get_adv_stats()
  6. 7 includes/quiz_stats/quiz_stats.admin.inc \quiz_stats_get_adv_stats()
  7. 7.4 includes/quiz_stats/quiz_stats.admin.inc \quiz_stats_get_adv_stats()
  8. 7.5 modules/quiz_stats/quiz_stats.admin.inc \quiz_stats_get_adv_stats()

Get stats for a single quiz. Maybe also for a single user.

Parameters

$vid: quiz revision id.

$uid: User id.

Return value

HTML page with charts/graphs.

1 string reference to 'quiz_stats_get_adv_stats'
quiz_stats_menu in modules/quiz_stats/quiz_stats.module
Implements hook_menu().

File

modules/quiz_stats/quiz_stats.admin.inc, line 72
Administration file for Quiz stats Module.

Code

function quiz_stats_get_adv_stats($vid, $uid = 0) {
  $charts = [];
  drupal_add_css(drupal_get_path('module', 'quiz_stats') . '/quiz_stats.css', [
    'type' => 'file',
    'weight' => CSS_THEME,
  ]);
  $charts['takeup'] = _get_date_vs_takeup_count_chart($vid, $uid);

  // Line chart/graph showing quiz takeup date along x-axis and count along
  // y-axis.
  $charts['status'] = _get_quiz_status_chart($vid, $uid);

  // 3D pie chart showing percentage of pass, fail, incomplete quiz status.
  $charts['top_scorers'] = _get_quiz_top_scorers_chart($vid, $uid);

  // Bar chart displaying top scorers.
  $charts['grade_range'] = _get_quiz_grade_range_chart($vid, $uid);
  return theme('quiz_stats_charts', [
    'charts' => $charts,
  ]);
}