You are here

function theme_quiz_progress in Quiz 6.6

Same name and namespace in other branches
  1. 8.6 quiz.theme.inc \theme_quiz_progress()
  2. 8.4 quiz.pages.inc \theme_quiz_progress()
  3. 8.5 quiz.theme.inc \theme_quiz_progress()
  4. 5.2 quiz.module \theme_quiz_progress()
  5. 5 quiz.module \theme_quiz_progress()
  6. 6.2 quiz.pages.inc \theme_quiz_progress()
  7. 6.3 quiz.pages.inc \theme_quiz_progress()
  8. 6.4 quiz.pages.inc \theme_quiz_progress()
  9. 6.5 quiz.pages.inc \theme_quiz_progress()
  10. 7.6 quiz.pages.inc \theme_quiz_progress()
  11. 7 quiz.pages.inc \theme_quiz_progress()
  12. 7.4 quiz.pages.inc \theme_quiz_progress()
  13. 7.5 quiz.theme.inc \theme_quiz_progress()

Theme a progress indicator for use during a quiz.

Parameters

$question_number: The position of the current question in the sessions' array.

$num_of_question: The number of questions for this quiz as returned by quiz_get_number_of_questions().

Return value

Themed html.

2 theme calls to theme_quiz_progress()
quiz_take_quiz in ./quiz.module
Handles quiz taking.
theme_quiz_take_question in ./quiz.pages.inc
Theme a question page.

File

./quiz.pages.inc, line 346
User pages.

Code

function theme_quiz_progress($question_number, $num_of_question) {

  // Determine the percentage finished (not used, but left here for other implementations).

  //$progress = ($question_number*100)/$num_of_question;

  // Get the current question # by adding one.
  $current_question = $question_number + 1;
  $output = '';
  $output .= '<div id="quiz_progress">';
  $output .= t('Question %x of %y', array(
    '%x' => $current_question,
    '%y' => $num_of_question,
  ));
  $output .= '</div><br />' . "\n";
  $output .= '<div class="countdown"></div>';
  return $output;
}