You are here

function theme_quiz_admin_summary in Quiz 6.4

Same name and namespace in other branches
  1. 8.4 quiz.admin.inc \theme_quiz_admin_summary()
  2. 5.2 quiz.module \theme_quiz_admin_summary()
  3. 5 quiz.module \theme_quiz_admin_summary()
  4. 6.6 quiz.admin.inc \theme_quiz_admin_summary()
  5. 6.2 quiz.admin.inc \theme_quiz_admin_summary()
  6. 6.3 quiz.admin.inc \theme_quiz_admin_summary()
  7. 6.5 quiz.admin.inc \theme_quiz_admin_summary()
  8. 7 quiz.admin.inc \theme_quiz_admin_summary()
  9. 7.4 quiz.admin.inc \theme_quiz_admin_summary()

Theme the summary page for admins.

Parameters

$quiz: The quiz node object.

$questions: The questions array as defined by _quiz_get_answers.

$score: Array of score information as returned by quiz_calculate_score().

$summary: Filtered text of the summary.

Return value

Themed html.

1 theme call to theme_quiz_admin_summary()
quiz_admin_results in ./quiz.admin.inc
Quiz result report page for the quiz admin section

File

./quiz.admin.inc, line 1910
Administrator interface for Quiz module.

Code

function theme_quiz_admin_summary($quiz, $questions, $score, $summary) {

  // To adjust the title uncomment and edit the line below:
  // drupal_set_title(check_plain($quiz->title));
  if (!$score['is_evaluated']) {
    drupal_set_message(t('This quiz has not been scored yet.'), 'warning');
  }

  // Display overall result.
  $output = '';
  $params = array(
    '%num_correct' => $score['numeric_score'],
    '%question_count' => $score['possible_score'],
  );
  $output .= '<div id="quiz_score_possible">' . t('This person got %num_correct of %question_count possible points.', $params) . '</div>' . "\n";
  $output .= '<div id="quiz_score_percent">' . t('Total score: @score %', array(
    '@score' => $score['percentage_score'],
  )) . '</div>' . "\n";
  if (isset($summary['passfail'])) {
    $output .= '<div id="quiz_summary">' . check_markup($summary['passfail'], $quiz->format, FALSE) . '</div>' . "\n";
  }
  if (isset($summary['result'])) {
    $output .= '<div id="quiz_summary">' . check_markup($summary['result'], $quiz->format, FALSE) . '</div>' . "\n";
  }

  // Get the feedback for all questions.
  require_once drupal_get_path('module', 'quiz') . '/quiz.pages.inc';
  $output .= drupal_get_form('quiz_report_form', $questions, TRUE, TRUE, TRUE);
  return $output;
}