// question types // --- create pdf document if ($l['a_meta_dir'] == 'rtl') { $dirlabel = 'L'; $dirvalue = 'R'; } else { $dirlabel = 'R'; $dirvalue = 'L'; } $isunicode = strcasecmp($l['a_meta_charset'], 'UTF-8') == 0; //create new PDF document (document units are set by default to millimeters) $pdf = new TCPDFEX(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, $isunicode); switch ($expmode) { case 1: // Set backlink QR-Code $pdf->setTCExamBackLink(K_PATH_URL . 'admin/code/tce_show_all_questions.php?subject_module_id=' . $module_id . '&subject_id=' . $subject_id); break; case 2: // Set backlink QR-Code $pdf->setTCExamBackLink(K_PATH_URL . 'admin/code/tce_show_all_questions.php?subject_module_id=' . $module_id); break; case 3: // Set backlink QR-Code $pdf->setTCExamBackLink(K_PATH_URL . 'admin/code/tce_show_all_questions.php'); break; } // set document information $pdf->SetCreator('TCExam ver.' . K_TCEXAM_VERSION . ""); $pdf->SetAuthor(PDF_AUTHOR); $pdf->SetTitle($doc_title); $pdf->SetSubject($doc_description);
$qtype = array('S', 'M', 'T', 'O'); // question types // --- create pdf document if ($l['a_meta_dir'] == 'rtl') { $dirlabel = 'L'; $dirvalue = 'R'; } else { $dirlabel = 'R'; $dirvalue = 'L'; } $isunicode = strcasecmp($l['a_meta_charset'], 'UTF-8') == 0; //create new PDF document (document units are set by default to millimeters) $pdf = new TCPDFEX(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, $isunicode); // set header backlink QR-Code $header_backlink = K_PATH_URL . 'admin/code/tce_edit_test.php?test_id=' . $test_id; $pdf->setTCExamBackLink($header_backlink); // set document information $pdf->SetCreator('TC' . 'Ex' . 'am' . ' ver.' . K_TCEXAM_VERSION . ''); $pdf->SetAuthor(PDF_AUTHOR); $pdf->SetTitle($doc_title); $pdf->SetSubject($doc_description); $pdf->SetKeywords('TCExam, ' . $doc_title); $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set image scale factor $pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING); //set margins $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); //set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); $pdf->setHeaderMargin(PDF_MARGIN_HEADER); $pdf->setFooterMargin(PDF_MARGIN_FOOTER);
$user_lastname = $m['user_lastname']; $user_firstname = $m['user_firstname']; $user_name = $m['user_name']; $test_start_time = $m['testuser_creation_time']; $test_score = $m['test_score']; $sqluc = 'SELECT testuser_comment FROM ' . K_TABLE_TEST_USER . ' WHERE testuser_id=' . $testuser_id . ''; if ($ruc = F_db_query($sqluc, $db)) { if ($muc = F_db_fetch_array($ruc)) { $testuser_comment = F_decode_tcecode($muc['testuser_comment']); } } else { F_display_db_error(); } $test_end_time = $m['test_end_time']; // Set backlink QR-Code $pdf->setTCExamBackLink(K_PATH_URL . 'admin/code/tce_show_result_user.php?testuser_id=' . $testuser_id . '&test_id=' . $test_id . '&user_id=' . $user_id); // ------------------------------------------------------------ // --- 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 // add a bookmark //$pdf->Bookmark($user_lastname.' '.$user_firstname.' ('.$user_name.'), '.$test_score.' '.F_formatPdfPercentage($test_score / $test_max_score), 0, 0);
case 5: // detailed report for all users with only open questions $doc_title = unhtmlentities($l['t_result_user']); $doc_description = F_compact_string(unhtmlentities($l['hp_result_user'])); break; default: echo $l['m_authorization_denied']; exit; } // --- create pdf document $isunicode = strcasecmp($l['a_meta_charset'], 'UTF-8') == 0; //create new PDF document (document units are set by default to millimeters) $pdf = new TCPDFEX(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, $isunicode); // Set backlink QR-Code if ($pubmode) { $pdf->setTCExamBackLink(K_PATH_URL . 'public/code/tce_test_allresults.php?' . $filter); } else { $pdf->setTCExamBackLink(K_PATH_URL . 'admin/code/tce_show_result_allusers.php?' . $filter); } // set document information $pdf->SetCreator('TCExam ver.' . K_TCEXAM_VERSION . ''); $pdf->SetAuthor(PDF_AUTHOR); $pdf->SetTitle($doc_title); $pdf->SetSubject($doc_description); $pdf->SetKeywords('TCExam, ' . $doc_title); $pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING); //set margins $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); //set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
$full_order_field = $order_field . ' DESC'; } // --- create pdf document if ($l['a_meta_dir'] == 'rtl') { $dirlabel = 'L'; $dirvalue = 'R'; } else { $dirlabel = 'R'; $dirvalue = 'L'; } $isunicode = strcasecmp($l['a_meta_charset'], 'UTF-8') == 0; //create new PDF document (document units are set by default to millimeters) $pdf = new TCPDFEX(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, $isunicode); // Set backlink QR-Code if ($_REQUEST['mode'] == 1) { $pdf->setTCExamBackLink(K_PATH_URL . 'admin/code/tce_show_result_allusers.php?test_id=' . $test_id . '&group_id=' . $group_id); } elseif ($_REQUEST['mode'] == 2) { $pdf->setTCExamBackLink(K_PATH_URL . 'admin/code/tce_show_result_questions.php?test_id=' . $test_id); } // set document information $pdf->SetCreator('TCExam ver.' . K_TCEXAM_VERSION . ''); $pdf->SetAuthor(PDF_AUTHOR); $pdf->SetTitle($doc_title); $pdf->SetSubject($doc_description); $pdf->SetKeywords('TCExam, ' . $doc_title); $pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING); //set margins $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); //set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
$page_elements = 9; $temp_order_field = 'total_score, user_lastname, user_firstname'; // --- create pdf document if ($l['a_meta_dir'] == 'rtl') { $dirlabel = 'L'; $dirvalue = 'R'; } else { $dirlabel = 'R'; $dirvalue = 'L'; } $isunicode = strcasecmp($l['a_meta_charset'], 'UTF-8') == 0; //create new PDF document (document units are set by default to millimeters) $pdf = new TCPDFEX(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, $isunicode); // Set backlink QR-Code //$pdf->setTCExamBackLink(K_PATH_URL.'admin/code/tce_pdf_user_results.php?user_id='.$user_id.'&startdate='.urlencode($startdate).'&enddate='.urlencode($enddate).'&orderfield='.urlencode($order_field)); $pdf->setTCExamBackLink(K_PATH_URL . 'admin/code/tce_pdf_user_results.php?user_id=' . $user_id); // set document information $pdf->SetCreator('TCExam ver.' . K_TCEXAM_VERSION . ''); $pdf->SetAuthor(PDF_AUTHOR); $pdf->SetTitle($doc_title); $pdf->SetSubject($doc_description); $pdf->SetKeywords('TCExam, ' . $doc_title); $pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING); //set margins $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); //set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); $pdf->setHeaderMargin(PDF_MARGIN_HEADER); $pdf->setFooterMargin(PDF_MARGIN_FOOTER); //set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);