Hi all,
I'm having some difficulty in printing the group name onto the Certificate. We are running Moodle 2.2.
Previously we ran 1.9 and I added the following code to the certificate.php file:
//Find current group
$currentgroup = get_current_group($course->id);
$group = get_record('groups', 'id', $currentgroup);
$groupname=$group->name;
along with
//Print the group name
cert_printtext(70, 345, 'C', 'Helvetica', '', 12, utf8_decode($groupname));
and that worked. However, it doesn't seem to be working in 2.2. I've used this:
//Find group name
$currentgroup=get_current_group($course->id);
$group=$DB->get_record('groups', 'id', $currentgroup);
$groupname=$group->name;
and this:
//Print the group name
certificate_print_text($pdf, $x + 60, $y + 305, 'C', 'Helvetica', '', 12, utf8_decode($groupname));
but I get errors. I'm not a PHP expert, but could anyone help me with this?
Thanks!
Grant Carruthers