Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Certificate Module

From MoodleDocs


Warning: This page is no longer in use. The information contained on the page should NOT be seen as relevant or reliable.


Note: This page is a work-in-progress. Feedback and suggested improvements are welcome. Please join the discussion on moodle.org or use the page comments.

This page will show the new features and the plan to implement them in the Certificate module for each Moodle release.

Changes planned for Moodle 1.8 contrib branch

The basis

Point to decide: Before start. Where will be develop the 1.8 version:

  • a) These will be developed under HEAD and backported to 18_STABLE once finished.
  • b) These will be developed directly under 18_STABLE, meging to HEAD while advancing.

Every one of the features described below will have its own bug created in the Tracker. With links from here for easy location.

The ordered list of features

(each one will be marked with Not done!, In progress!, Done!, with the name of the developer assigned between brackets.

  1. Update the module install.xml and create the upgrade.php file (confirm save->savecert is the first change to be added for 1.8!). This will provide cross db installation and upgrade of the module.
  2. Split conditions to allow certificate to a new fieldset.
    • Conditions will be:
      • a) % of total grade raised.
      • b) 1...n quizzes grades raised.
      • c) 1...n surveys filled by the student
    • With:
      • All the specified quizzes must be passed (logical AND between them). (b)
      • All the specified surveys must be filled (logical AND between them). (c)
    • Finally:
      • Then (a OR b) AND c will be checked to allow display/download.
  3. Define n texts, with position and size to be inserted in the certificate ordering them by y,x descending. Fieldset can be hidden/showed like the user profile form.
  4. Upload (to moddata/certificate) and define n images, with position and size to be inserted in the certificate ordering them by y,x descending. Fieldset can be hidden/showed like the user profile form.
  5. Find a better solution for the preview certificate feature. Analyse the XHTML strict object alternative.
  6. Allow to configure if the student/mainteacher/admin should receive one email with the text: Mickey Mouse accessed the certifacte on XX/XX/YYYY".
  7. Coma separated list of email addresses to be informed about certificate accesses.
  8. Roles, accessibility ...
  9. Rework backup/restore to handle everything above.

Changes planned for Moodle 2.0

PDF Style

The certificate will no longer use the fpdf library, it will use only the tcpdf library via the new lib/pdflib.php which will be called from view.php.

The code in lib used to print a certificate has been updated to reflect new options in tcpdf, e.g. the draw_frame functions have been simplified using SetLineStyle and Rect and cert_printtext now uses writeHTMLCell.

The new printtext function accepts html and wraps long lines.

Orientation is now a variable (an option chosen upon certificate creation).

There will be four new default certificate types dependent upon paper size (A4 or Letter) and font embedding (embedded or non-embedded). db/upgrade has been modified so that upon upgrade, previous landscape certificate types will upgraded with the landscape orientation and portrait types will be upgraded with the new portrait orientation. Previous certificate types will be changed to their appropriate new types. This means that any custom made certificate types will have to be updated accordingly.

The default types will use the dejavusans font for embedding, and Helvetica and Times for non-embedded fonts. Non-embedded fonts are recommended whenever possible to greatly reduce the size of the pdf.

All $x, $y, $w,$h (e.g. x,y variables for text, x,y,w,h variables for border, etc.) each now have two sets of variables--one for landscape and one for portrait, making it easier to customize placement and images.

Watermark images are now printed with an alpha setting, making it easier to customize a watermark image.

Each certificate is now created with the pdf title set as the certificate name.

Certificate Creation

There will be a new option: Reissue Certificates that can be set upon certificate creation. If this option is set to Yes, then each time a user clicks to receive a certificate, a new entry will be made in the certificate_issues table with new date, grade, code, etc. Report.php and index.php will show only the last created certificate for each student(?). This code development was supported by Lester Cunningham.

The activity locking code will no longer be available. The certificate will instead use the core conditional activities code. Any previous certificates using the activity locking code will have to be updated (edited and re-set) upon upgrade.