Пример #1
0
 $pdf->Cell($data_cell_width, $data_cell_height, $testdata['test_score_wrong'], 0, 1, $dirvalue, 0);
 // score for missing answer
 $pdf->Cell(1.5 * $data_cell_width, $data_cell_height, $l['w_score_unanswered'] . ': ', 0, 0, $dirlabel, 0);
 $pdf->Cell($data_cell_width, $data_cell_height, $testdata['test_score_unanswered'], 0, 1, $dirvalue, 0);
 // max score
 $pdf->Cell(1.5 * $data_cell_width, $data_cell_height, $l['w_max_score'] . ': ', 0, 0, $dirlabel, 0);
 $pdf->Cell($data_cell_width, $data_cell_height, $testdata['test_max_score'], 0, 1, $dirvalue, 0);
 // minimum required score to pass the exam
 if ($testdata['test_score_threshold'] > 0) {
     $pdf->Cell(1.5 * $data_cell_width, $data_cell_height, $l['w_test_score_threshold'] . ': ', 0, 0, $dirlabel, 0);
     $pdf->Cell($data_cell_width, $data_cell_height, $testdata['test_score_threshold'], 0, 1, $dirvalue, 0);
 }
 $boxEndY = $pdf->GetY();
 $pdf->SetFont(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA);
 // test description
 $pdf->writeHTMLCell(0, $boxEndY - $infoStartY + 4, PDF_MARGIN_LEFT + $info_cell_width * 2, $infoStartY - 2, F_decode_tcecode($testdata['test_description']), 1, 1);
 // print box around test info
 $pdf->SetY($boxStartY);
 $pdf->Cell($page_width, $boxEndY - $boxStartY + 2, '', 1, 1, 'C', 0);
 // --- end test info ---
 $pdf->Ln(5);
 /*
 $pdf->SetFont(PDF_FONT_NAME_DATA, 'B', PDF_FONT_SIZE_DATA);
 $pdf->Cell($data_cell_width_third, $data_cell_height, "#", 1, 0, 'C', 1);
 $pdf->Cell($data_cell_width_third, $data_cell_height, $l['w_score'], 1, 0, 'C', 1);
 $pdf->Cell(0, $data_cell_height, $l['w_question'], 1, 1, 'C', 1);
 $pdf->Ln($data_cell_height);
 $pdf->SetFont(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA);
 */
 // IDs of MCSA questions with more than one correct answer
 $right_answers_mcsa_questions_ids = '';
                // --- start page data ---
                $pdf->AddPage();
                // set barcode
                $pdf->setBarcode($subject_id);
                $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 subject info ---
                $pdf->SetFont(PDF_FONT_NAME_DATA, 'B', PDF_FONT_SIZE_DATA * HEAD_MAGNIFICATION);
                $pdf->Cell($page_width, $data_cell_height * HEAD_MAGNIFICATION, '' . $module_name . ' :: ' . $subject_name . '', 1, 1, $defalign, 1);
                $pdf->SetFont(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA);
                $pdf->writeHTMLCell(0, $data_cell_height, PDF_MARGIN_LEFT, $pdf->GetY(), $subject_description, 1, 1);
                // --- end subject info ---
                $pdf->Ln(5);
                // ---- questions
                $sqlq = 'SELECT *
					FROM ' . K_TABLE_QUESTIONS . '
					WHERE question_subject_id=' . $subject_id . '
					ORDER BY question_enabled DESC, question_position, question_description';
                if ($rq = F_db_query($sqlq, $db)) {
                    $pdf->SetFont(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA);
                    $itemcount = 1;
                    while ($mq = F_db_fetch_array($rq)) {
                        $question_disabled = 0;
                        if (!F_getBoolean($mq['question_enabled'])) {
                            $question_disabled = 1;
                        }
Пример #3
0
 // Additional test information that could be printed if needed
 $test_results_to_users
 $test_report_to_users
 $test_random_questions_select
 $test_random_questions_order
 $test_random_answers_select
 $test_random_answers_order
 $test_comment_enabled
 $test_menu_enabled
 $test_noanswer_enabled
 $test_mcma_radio
 */
 $boxEndY = $pdf->GetY();
 $pdf->SetFont(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA);
 // test description
 $pdf->writeHTMLCell(0, $boxEndY - $infoStartY + 4, PDF_MARGIN_LEFT + $info_cell_width * 2, $infoStartY - 2, $test_description, 1, 0);
 $boxEndY = max($boxEndY, $pdf->GetY());
 // print box around test info
 $pdf->SetY($boxStartY);
 $pdf->Cell($page_width, $boxEndY - $boxStartY + 2, '', 'LTRB', 1, 'C', 0);
 // --- end test info ---
 // print user's comments
 if (!empty($testuser_comment)) {
     $pdf->Cell($page_width, $data_cell_height, '', 0, 1, '', 0);
     $pdf->writeHTMLCell($page_width, $data_cell_height, '', '', $testuser_comment, 1, 1);
 }
 $pdf->Ln(5);
 $topicresults = array();
 // per-topic results
 // get test basic score
 $test_basic_score = 1;