From 9b538e2bf598cbf51c3effcb39e665c1c35841a3 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 10 May 2017 17:11:13 -0300 Subject: [PATCH] =?UTF-8?q?Adapta=C3=A7=C3=A3o=20para=20parametrizar=20exi?= =?UTF-8?q?bi=C3=A7=C3=A3o=20de=20nota=20em=20cert=5Fpresencial?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- type/cert_presencial/certificate.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/type/cert_presencial/certificate.php b/type/cert_presencial/certificate.php index 369084d..396d80f 100644 --- a/type/cert_presencial/certificate.php +++ b/type/cert_presencial/certificate.php @@ -31,6 +31,16 @@ if (!defined('MOODLE_INTERNAL')) { $group = end(groups_get_all_groups($course->id, $USER->id)); $group_name = format_string($group->name); $group_description = format_text($group->description, $group->descriptiontext); + +#Obtem a nota do aluno, se o curso estiver configurado para gerar +#certificado com nota. Do contrário, o campo virá sempre em branco. +$grade=certificate_get_grade($certificate, $course); +if( $grade != '' ) { + #Se houver nota, acrescenta vírgulas antes e depois + $grade = $grade . ', '; +} + + /* $style = << @@ -108,7 +118,7 @@ $pdf->SetTextColor(0, 0, 0); certificate_print_text($pdf, $x, $y, 'C', 'freesans', '', 20, get_string('title', 'certificate')); certificate_print_text($pdf, $x, $y + 15, 'C', 'freesans', '', 18, get_string('certify', 'certificate')); certificate_print_text($pdf, $x, $y + 25, 'C', 'freesans', 'B', 18, mb_strtoupper(fullname($USER), 'UTF-8').", CPF nº {$USER->profile['cpf']}"); -certificate_print_text($pdf, $x, $y + 35, 'C', 'freesans', '', 18, "realizou, na modalidade presencial, ".certificate_get_grade($certificate, $course).", o curso"); +certificate_print_text($pdf, $x, $y + 35, 'C', 'freesans', '', 18, "realizou, na modalidade presencial, " . $grade . "o curso"); certificate_print_text($pdf, $x, $y + 45, 'C', 'freesans', 'B', 18, mb_strtoupper($course->fullname, 'UTF-8')); $tagvs = array('p' => array(0 => array('h' => 0, 'n' => 0), 1 => array('h' => 0, 'n'=> 0))); $pdf->setHtmlVSpace($tagvs);