It would be handy to optionally make course certificates available to users who have completed courses. In another application we have effectively used the http://www.fpdf.org/ library to make very nice PDF certificates. I propose...

1. Add an additional flag, 'Allow Certificates', in the CCK definition 'Course Settings' area and an override on the node.
2. Add a role permission, 'view SCORM Cloud certificate'.
3. If 'Allow Certificates' AND 'view SCORM Cloud certificate' is true AND Status='completed' AND Success='Passed' then add an additional label 'Certificate:' and link 'print' that opens a new window with their PDF certificate.
4. The new feature should be available on the node, as SCORM Cloud View field type, and as a View CCK Content type (both in the block display format and individual field display format).
5. I could personally write the function that uses fpdf to print the certificate to help out and we may want to design it so this function could be easily overridden in the theme template.
6. To print the certificate well we would need access to the $user, user profile fields, the course $node, and the completed registration information.

Thoughts on the effort involved?

Comments

djdevin’s picture

You might want to take a look at http://drupal.org/project/certificate which handles certificate access, mapping and PDF generation :) I'm pretty sure this would work out for you. All that would be required is implementing hook_access_certificate($node, $user) and returning true/false if the user can receive a certificate for that node. The body of the certificate is token-enabled.

You could also check out http://drupal.org/project/course which actually has some support for cck_scorm (non-cloud solution) but it might point you in the right direction.

scottrigby’s picture

These could work together even #1606772: Integrate with Course module

webservant316’s picture

I will check out http://drupal.org/project/certificate. My current plan is to use http://drupal.org/project/dynamicfield with a php snippet that utilizes some php code we have already written that generates pdf certificates with http://www.fpdf.org. I will post back when the solution for my use case is finished.

djdevin’s picture

The PDF generation part in Certificate is actually done by Print module (https://drupal.org/project/print) which supports wkhtmltopdf (best PDF generator, IMO) and other pure PHP ones. I'd consider checking that out before writing a new module or any custom code. Dynamicfield also requires your admins to know PHP, where using something like certificate/print module would let them use safe tokens and not break the site accidentally.

webservant316’s picture

I see the 'certificate' module has a few dependencies and no documentation. It sounds promising but need a few questions answered about the module before I want to dive into it. Creating a ticket in the 'certificate' issue queue.

'certificate' module issue added here - http://drupal.org/node/1608516

scottrigby’s picture

@webservant316 A README still needs to be written but Certificate hook documentation is linked from the project page: http://drupalcode.org/project/certificate.git/blob/refs/heads/6.x-1.x:/c...

webservant316’s picture

Status: Active » Fixed

After diving into this the flexible and cost effective solution for my use case was to use existing PHP code we've already written that uses the free fpdf PDF generator combined with drupal.org/project/dynamicfield to make a certificate available on the course node if the student has passed the course. I also used Views to make the data for the successful course registration available in my PHP code. So in summary...

1. Used Views to make to get the success course registration

    $view = views_get_view('View_that_finds_the_most_recent_successful_registration_for_current_user');
    $view->preview('default', array($node->nid));

2. Used drupal.org/project/dynamicfield to put a link to the certificate on the node. The above code and more was used gather the data for my certificate function.

3. Used http://www.fpdf.org/ to build my certificate.

I am sure other solutions have equal merits such as the drupal.org/project/certificate module. After building a solution it seems clear to the maintainer that no special integration to any particular solution is planned for the scorm_cloud module.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.