Exemple #1
0
if ($mode != 3) {
    $pdf->AddPage();
    // print document name (title)
    $pdf->SetFont(PDF_FONT_NAME_DATA, 'B', PDF_FONT_SIZE_DATA * K_TITLE_MAGNIFICATION);
    $pdf->Cell(0, 0, $doc_title, 1, 1, 'C', 1);
    $pdf->Ln(5);
    // print test stats table
    $pdf->printTestResultStat($ts, $pubmode, $display_mode);
    if ($show_graph) {
        // display graph
        $pdf->Ln(5);
        $pdf->printSVGStatsGraph($ts['svgpoints']);
    }
    if ($display_mode > 1) {
        // print question
        $pdf->Bookmark($l['w_statistics']);
        $pdf->printQuestionStats($ts['qstats'], $display_mode);
    }
}
if ($mode > 2) {
    // print testuser details
    if ($testuser_id == 0) {
        foreach ($ts['testuser'] as $tstusr) {
            if (!$pubmode or F_getBoolean($tstusr['test']['test_report_to_users'])) {
                $pdf->AddPage();
                $pdf->printTestUserInfo($tstusr, $onlytext, $pubmode);
            }
        }
    } else {
        if (!$pubmode or F_getBoolean($ts['testuser']['\'' . $testuser_id . '\'']['test']['test_report_to_users'])) {
            $pdf->AddPage();
 // ------------------------------------------------------------
 // --- start page data ---
 $pdf->AddPage();
 // set barcode
 $pdf->setBarcode($test_id . ':' . $user_id . ':' . $test_start_time);
 $pdf->SetFillColor(204, 204, 204);
 $pdf->SetLineWidth(0.1);
 $pdf->SetDrawColor(0, 0, 0);
 // print document name (title)
 $pdf->SetFont(PDF_FONT_NAME_DATA, 'B', PDF_FONT_SIZE_DATA * K_TITLE_MAGNIFICATION);
 $pdf->Cell(0, $main_cell_height * K_TITLE_MAGNIFICATION, $doc_title, 1, 1, 'C', 1);
 $pdf->Ln(5);
 // display user info
 if ($_REQUEST['mode'] >= 3) {
     // add a bookmark
     $pdf->Bookmark($user_lastname . ' ' . $user_firstname . ' (' . $user_name . '), ' . $test_score . ' ' . F_formatPdfPercentage($test_score / $test_max_score), 0, 0);
     // calculate some sizes
     $user_elements = 4;
     $user_data_cell_width = round($page_width / $user_elements, 2);
     // print table headings
     $pdf->SetFont(PDF_FONT_NAME_DATA, 'B', PDF_FONT_SIZE_DATA);
     $pdf->Cell($user_data_cell_width, $data_cell_height, $l['w_lastname'], 1, 0, 'C', 1);
     $pdf->Cell($user_data_cell_width, $data_cell_height, $l['w_firstname'], 1, 0, 'C', 1);
     $pdf->Cell($user_data_cell_width, $data_cell_height, $l['w_user'], 1, 0, 'C', 1);
     $pdf->Cell($user_data_cell_width, $data_cell_height, $l['w_score'], 1, 1, 'C', 1);
     $pdf->SetFont(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA);
     // minimum required score to pass the exam
     $passmsg = '';
     if ($test_score_threshold > 0) {
         if ($test_score >= $test_score_threshold) {
             $passmsg = ' - ' . $l['w_passed'];