Example #1
0
// Show certificate link.
$certificate = array();
$actionsLeft = '';
if ($category != '0') {
    $cat = new Category();
    $category_id = intval($_GET['selectcat']);
    $course_id = CourseManager::get_course_by_category($category_id);
    $show_message = $cat->show_message_resource_delete($course_id);
    if ($show_message == '') {
        // Student
        if (!api_is_allowed_to_edit() && !api_is_excluded_user_type()) {
            $certificate = Category::register_user_certificate($category_id, $stud_id);
            if (isset($certificate['pdf_url'])) {
                $actionsLeft .= Display::url(Display::returnFontAwesomeIcon('file-pdf-o') . get_lang('DownloadCertificatePdf'), $certificate['pdf_url'], ['class' => 'btn btn-default']);
            }
            $currentScore = Category::getCurrentScore($stud_id, $category_id, $course_code, $session_id, true);
            Category::registerCurrentScore($currentScore, $stud_id, $category_id);
        }
    }
}
if (!api_is_allowed_to_edit(null, true)) {
    $actionsLeft .= Display::url(Display::returnFontAwesomeIcon('file-pdf-o') . get_lang('DownloadReportPdf'), api_get_self() . "?" . api_get_self() . "&action=export_table", ['class' => 'btn btn-default']);
}
echo $toolbar = Display::toolbarAction('gradebook-student-actions', array(0 => $actionsLeft, 1 => ''));
if (api_is_allowed_to_edit(null, true)) {
    // Tool introduction
    Display::display_introduction_section(TOOL_GRADEBOOK, array('ToolbarSet' => 'AssessmentsIntroduction'));
    if (isset($_GET['selectcat']) && $_GET['selectcat'] != 0) {
        //
    } else {
        if (isset($_GET['selectcat']) && $_GET['selectcat'] == 0 || isset($_GET['cidReq']) && $_GET['cidReq'] !== '' || isset($_GET['isStudentView']) && $_GET['isStudentView'] == 'false') {