You are here

function theme_quiz_stats_charts in Quiz 8.4

1 theme call to theme_quiz_stats_charts()
quiz_stats_get_adv_stats in modules/quiz_stats/quiz_stats.admin.inc
Get stats for a single quiz. Maybe also for a single user.

File

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

Code

function theme_quiz_stats_charts($variables) {
  $chart = $variables['charts'];
  $html = '';
  $chart_found = FALSE;
  if (!function_exists('_quiz_stats_print_chart')) {
    function _quiz_stats_print_chart(&$chart) {
      if (is_array($chart)) {
        $html .= '<h2 class="quiz-charts-title">' . $chart['title'] . '</h2>' . "\n" . $chart['chart'] . "\n" . $chart['explanation'] . "\n";
        $chart_found = TRUE;
      }
    }
  }
  _quiz_stats_print_chart($charts['takeup']);
  _quiz_stats_print_chart($charts['top_scorers']);
  _quiz_stats_print_chart($charts['status']);
  _quiz_stats_print_chart($charts['grade_range']);
  if (!$chart_found) {
    $html .= t('There are no statistics for this quiz (or quiz revision). This is probably because nobody has yet run this quiz (or quiz revision). If the quiz has multiple revisions, it is possible that the other revisions do have statistics. If this is the last revision, taking the quiz should generate some statistics.');
  }
  return $html;
}