Category::getUrl(), 'name' => get_lang('Assessments'), ]; $categoryId = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0; $evaluationId = isset($_GET['selecteval']) ? (int) $_GET['selecteval'] : 0; $category = Category::load($categoryId); $userId = Security::remove_XSS($_GET['userid']); $allevals = $category[0]->get_evaluations($userId, true); $alllinks = $category[0]->get_links($userId, true); if (!empty($categoryId)) { $addparams = [ 'userid' => $userId, 'selectcat' => $categoryId, ]; } else { $addparams = [ 'userid' => $userId, 'selecteval' => $evaluationId, ]; } $user_table = new UserTable($userId, $allevals, $alllinks, $addparams); if (isset($_GET['exportpdf'])) { $datagen = new UserDataGenerator($userId, $allevals, $alllinks); $data_array = $datagen->get_data( UserDataGenerator::UDG_SORT_NAME, 0, null, true ); $newarray = []; $displayscore = ScoreDisplay::instance(); foreach ($data_array as $data) { $newarray[] = array_slice($data, 1); } $userInfo = api_get_user_info($userId); $html .= get_lang('Results and feedback').' : '.$userInfo['complete_name_with_username'].' ('.api_get_local_time().')'; if ($displayscore->is_custom()) { $header_names = [ get_lang('Score'), get_lang('Course'), get_lang('Category'), get_lang('ScoreAverage'), get_lang('Result'), get_lang('Ranking'), ]; } else { $header_names = [ get_lang('Score'), get_lang('Course'), get_lang('Category'), get_lang('ScoreAverage'), get_lang('Result'), ]; } $table = new HTML_Table(['class' => 'data_table']); $row = 0; $column = 0; foreach ($header_names as $item) { $table->setHeaderContents($row, $column, $item); $column++; } $row = 1; if (!empty($newarray)) { foreach ($newarray as $data) { $column = 0; $table->setCellContents($row, $column, $data); $table->updateCellAttributes($row, $column, 'align="center"'); $column++; $row++; } } $html .= $table->toHtml(); $pdf = new PDF(); $pdf->content_to_pdf($html); exit; } $actions = '