You are here

function theme_quiz_progress in Quiz 5

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. 6.6 quiz.pages.inc \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

1 theme call to theme_quiz_progress()
theme_quiz_take_question in ./quiz.module
Theme a question page

File

./quiz.module, line 1699
Quiz Module

Code

function theme_quiz_progress($question_number, $num_of_question) {

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

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

  // Get the current question # by adding one
  $current_question = $question_number + 1;

  // return html
  $output = '';
  $output .= '<div id="quiz_progress">';
  $output .= t('Question %x of %y', array(
    '%x' => $current_question,
    '%y' => $num_of_question,
  ));
  $output .= '</div><br />' . "\n";
  return $output;
}