예제 #1
0
if ($exam->email_taker and !is_user_logged_in()) {
    watupro_ask_for_email($exam);
}
// the exam is shown below
$question_count = $cat_count = $page_count = $num_pages = 1;
$question_ids = '';
$total = sizeof($all_question);
if ($exam->single_page == WATUPRO_PAGINATE_CUSTOM_NUMBER) {
    if ($exam->custom_per_page == 0) {
        $exam->custom_per_page = 1;
    }
    // this should never be zero
    $num_pages = ceil($total / $exam->custom_per_page);
}
if ($exam->show_pagination) {
    echo WTPExam::paginator($total, @$in_progress);
}
$question_catids = array();
// used for category based pagination and category header
$qct = 0;
if (empty($exam->time_limit) or !empty($_POST['watupro_start_timer'])) {
    // on timed exams questions should not be shown before the timer starts
    foreach ($all_question as $ques) {
        echo watupro_cat_header($exam, $qct, $ques);
        if ($exam->single_page == WATUPRO_PAGINATE_CUSTOM_NUMBER) {
            echo watupro_paginate_header($exam, $qct, $num_pages);
        }
        $qct++;
        echo "<div class='watu-question' id='question-{$question_count}'>";
        if (!$single_page and $cnt_questions > 1) {
            echo "<p class='watupro-qnum-info alignRight'>" . sprintf(__("Question Compeleted: %d out of %d", 'watupro'), $qct, $total) . "</p>";